Where to store Vertices?

Started by
0 comments, last by jamessharpe 21 years, 2 months ago
I am currently designing a model class to derive classes from to load files such as md2, md3 etc. I am wondering where would be the best place to store the vertices. Is it more efficient to have one big vertex array that contains all the vertices( this is what i am currently doing for my world geometry), or should I be storing the individual vertices within the class that uses them? The thing that worries me about using one large array is that for animation, this would mean a lot of extra verts, whereas if I had them locally I could reassign the vertex pointers to the correct array and then render them. Would this cause a large performance hit? James
Advertisement
No, store the model verts in a big lump. You shouldn''t need to screw with them when you do animation... instead, build indices to the vertices and call glDrawElems(). This way, memory is conserved while still being fast enough (you still need an array of ints for each frame, tho)

This topic is closed to new replies.

Advertisement