Storing and rendering models

Started by
2 comments, last by Jenison 21 years, 7 months ago
Say I have N models that need to be animated. All are model animations with no transformations. How would I store this? In vertex lists? or simply have each frame in an array and call glVertex3f for each one? I''m confused ...
Advertisement
First off, if you''re rendering lots poly, I would avoid using glBegin/End with glVertex as much as possible. It''s better to use vertex array (glVertexPointer and glDrawArrays). Better than that is to use an element array (glIndexPointer and glDrawElements).

When you load each frame of animation from a file, just put them in a format that''s acceptible by glVertexPointer and render with glDrawArray. If the model already has inidies then load those to and set them to glIndexPointer and render with glDrawElements).

Although you could put all frames of animation into 1 gigantic list of vertices, there no real reason for doing this. Just set up glVertexPointer for each frame.

If you want to get even better performance you can look into some of the vendor specific OpenGL extensions such as ATI_vertex_array_object.
Thanks for the reply! I will be researching this right away. While I don''t think I''m ready for vendor specific calls, does ATI and NVida publish such extentions and how to use them? also, how do you identify which extentions are supported? call it and see if it fails?

Thanks!
Jenison

when youre starting out a common mistake is to focus on speed,
fucus first on getting things right. then worry about speed.

http://uk.geocities.com/sloppyturds/gotterdammerung.html

This topic is closed to new replies.

Advertisement