Fastest Object drawing technique

Started by
1 comment, last by y2kiah 20 years, 10 months ago
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?
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.
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.

This topic is closed to new replies.

Advertisement