Guest User

Untitled

a guest
Jan 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. uint16_t *indices = static_cast<uint16_t *>(indexBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));
  2.  
  3.  
  4. int l, t;
  5. int numTriangles = out.numberoftrifaces;
  6. for (l = 0, t = 0; t<numTriangles; t += 3) {
  7. // Each vertex has to be listed twice
  8. indices[l] = out.trifacelist[t]; l++;
  9. indices[l] = out.trifacelist[t + 1]; l++;
  10. indices[l] = out.trifacelist[t + 1]; l++;
  11. indices[l] = out.trifacelist[t + 2]; l++;
  12. indices[l] = out.trifacelist[t + 2]; l++;
  13. indices[l] = out.trifacelist[t]; l++;
  14. }
  15.  
  16.  
  17. indexBuffer->unlock();
Add Comment
Please, Sign In to add comment