Pointer array instead of index array for mesh construction

Started by
1 comment, last by CyberSlag5k 19 years, 1 month ago
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?
Without order nothing can exist - without chaos nothing can evolve.
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."
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.
Without order nothing can exist - without chaos nothing can evolve.

This topic is closed to new replies.

Advertisement