PDA

View Full Version : Rendering frames of animation. VertexArrays?



Anonymous Coward
10-25-2003, 02:39 AM
Hi, lets see if you can help me.

The way I'm doing animation in my current project is importing each keyframe from 3DSMax. I'm not sure how should I render each keyframe, right now I'm calling glBegin() glVertex() glEnd(), but I suppose I should create a vertex array for each key frame and then render the current vertex array. Is this correct?

Which is the best way for doing this, performance-wise? (I can't use display lists, because the models will have animated textures and will be affected by lighting).
Thanks in advance.

Zengar
10-25-2003, 07:55 AM
As I know 3DS stores some sort of key positions, and your task is to only interpolate it. The best way is to use different vertex arrays for key positions and then blend them using linear interpolation via a vertex program.

jwatte
10-25-2003, 02:56 PM
"importing each key frame from 3dsmax" can mean many things. Key frames could be for a skeletal pose, and you could be interpolating bone positions/orientations between these key frames. Then, to render the model, you'd write an ARB_vertex_program which does skinning by looking at bone matrices out of a palette.

Or it could mean exporting the entire set of vertices for each key frame, a la good-old MD2 files. In that case, DrawRangeElement() is certainly a better way to get performance than immediate mode Vertex() calls. ARB_vertex_buffer_object storage of the vertex data would ensure optimal vertex transfer speed.