Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


different index arrays of vertex and normals possible with glDrawElements using VBO??

This topic is 5410 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, im a beginner and have to make an OBJ loader using octree and view frustum culling, its done now i have to use VBO, my problem is that i have different index arrays of vertex and normals, what i want to do is something like this glEnableClientState(GL_NORMAL_ARRAY); glDrawElements(GL_TRIANGLES,qtdAteMudar,GL_UNSIGNED_INT,indicesN); glDisableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glDrawElements(GL_TRIANGLES,qtdAteMudar*3,GL_UNSIGNED_INT,indicesV); glDisableClientState(GL_VERTEX_ARRAY); but seems not to be possible in same frame make 2 times glDrawElements, any solution or i have to change the data of normals to be equal to the index of vertex??? tks and sorry for my english

Share this post

Link to post
Share on other sites
Nope, sorry, it doesn''t work that way. You set the various pointers, then call glDrawElements() only once. To do it properly, you need one entry in each array for every unique vertex. If a vertex has the same position but two different sets of UV coords for drawing two different faces, then in actuality you will need two unique vertices for that point, one for each set of UVs. The data for each component of the vertex needs to be at the same position in every array. Duplicate vertices if you have to.

Blender--The Gimp--Python--Lua--SDL

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!