Jump to content
  • Advertisement
Sign in to follow this  

Pointer array instead of index array for mesh construction

This topic is 4826 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

I've been storing my mesh as an array of indices referencing a list of unique vertices. So when I do my drawing, I refer to the data like this: glVertex3f(vertList[indexes].x, vertList[indexes].y, vertList[indexes].z) Would it be more efficient to store an array of pointers instead? So I could just do this: glVertex3f(*(indexes), *(indexes[i+1]), *(indexes[i+2]) It that way I can easily manipulate the vertices as I wish as well. Thoughts?

Share this post


Link to post
Share on other sites
Advertisement
I must admit I'm slightly confused as to what you're trying to do there, but it doesn't look like it's going to make it more efficient.

Perhaps you should look up "vertex arrays" as a more efficient method of delivering geometry, and once you've got the hang of that, "vertex buffer objects."

Share this post


Link to post
Share on other sites
I know vertex arrays, I'm sort of modifying the idea. With a vertex array you can either pass a list of vertices or a list of indexed vertices...I'd like to maintain a list of pointers to vertices. That way I can refer to them and modify them. Although I guess since pointers kind of operate like arrays it's probably not that efficient. Oh well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!