Jump to content
  • Advertisement

Archived

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

Jenison

Storing and rendering models

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

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 ...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!