Jump to content
  • Advertisement

Archived

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

y2kiah

Fastest Object drawing technique

This topic is 5659 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''m at the point where I need to consider the best way to draw the many static or dynamic objects in my world. I think the fastest way to do this is to use static compiled vertex arrays for the models and position them by pushing the current MODELVIEW matrix, make my calls to glRotate and glTranslate and rendering the object, and popping the matrix. This will position them correctly but the object''s vertices aren''t actually translated to world points, so polygon-perfect collision detection won''t be an option. I could easily update only a bounding sphere or box for the object and use that for collision detection, but many objects will require poly-perfect checking, and it would be redundant to translate my own vertices only to do it again with OpenGL calls when it comes time to render. I''m thinking about just using dynamic vertex buffers and translating the points manually each frame, hence removing the problem...although it seems like a slow alternative to using the GPU. How do you guys handle this issue?

Share this post


Link to post
Share on other sites
Advertisement
display list would be your best bet for cre8ing multiple reacurences of the same object. if you have a struct that contains each objects x,y,z then you can use this information to "offset" the originall bounding box, persuming the bounding box and model have a center of 0,0,0, to detect for colision.

This would meen though that in one operation you would need to draw the models and in another test for colision.

Share this post


Link to post
Share on other sites
some more thoughts...

To handle interpolation between animation frames AND translation from model to world space I''ve decided to set up a "world_points" buffer that will store the vertices for drawing, and will be refilled every frame and drawn using the same original index buffer. Poly perfect collision detection will only be allowed with static objects, so this will be a special case where the "world_points" buffer only needs to be calculated once during initialization. That way, drawing static objects will be very fast while collision detection with them will be slower, and for dynamic objects the opposite. They seem to balance each other out.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!