I am creating an animation in Maya that is a minute long, and I intend to render it in OpenGL. I'm doing this is as a project at college.
The scene consists of just a human face making distorted expressions. The mesh has about 2200 quad faces.
I found a perl script that converts Wavefront object files to vertex and normal arrays. I intend to animate in Maya at 24fps, then export the mesh in every frame to a Wavefront object file, and then run all of them through the perl script which will give me vertex and normal arrays.
So, to test the feasibility, I converted two frames of the animation in Maya to object files and ran it through the script (after tweaking it) which gave me thousands of glVertex
and glNormal
calls. I copied all that to my C++ program and compiled it. It runs smoothly.
Considering how large the program will be when I copy 60sec*24frame worth of glVertex
and glNormal
statements into the program, I want to try using VBOs. So, I read about it but I'm not quite grasping the implementation.
So my first question is : What is best method to implement VBOs in this case?
I'm thinking of 2D arrays for both vertices and normals, one for every frame; and GL_STATIC_DRAW_ARB
for the "usage" parameter of the glBufferDataARB()
.
Say, if my animation is 5 frames long, my face mesh consists of 2200 vertices and normals, then I'll create:
GLfloat face_vertices[5][2200] = {.....};
GLfloat face_normals[5][2200] = {.....};
My second question : Will the above code work or perform "well" with VBOs?
Also, I'm unsure if this information is important, but my computer is running on an Intel 82945G graphic card, and I'm pretty sure the PCs at my college are running on Intel as well. Just thought I'd mention that.
UPDATE
Performance is also a concern.