Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. for(std::vector<Face>::iterator it = faces.begin();it != faces.end();++it) {
  2. const Face &f = *it;
  3.  
  4. std::Vector<GLint> indices;
  5. std::Vector<GLfloat> positions;
  6.  
  7. for(int i=0;i<f.vcount;++i){
  8. const Vertex &v = m_vert[f.verts[i]];
  9.  
  10. positions.push_back(v.x);
  11. positions.push_back(v.y);
  12. positions.push_back(v.z);
  13.  
  14. indices.push_back(f.verts[i]);
  15. }
  16.  
  17. glVertexPointer(3,GL_INT,3,&positions[0]);
  18.  
  19. glDrawElements(GL_POLYGON,indices.size(),GL_UNSIGNED_INT,&indices[0]);
  20.  
  21. positions.clear();
  22. indices.clear();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement