How do I place my character in the middle of the scene? The "center" of the model is not (0, 0, 0) -let's say it's (123.34, 26.56, 756.12): should I translate and scale the MODELVIEW matrix based on model min and max coords before drawing?
The Red book's chapter on camera positioning is quite comprehensive. Revisit it and make sure you understand the duality of camera/object positioning encoded in the modelview matrix.
I tend to do things like this, at least conceptually:
- define a world-space position and orientation for the camera
- define world-space positions and orientations of objects in the scene.
- multiply each object by the matrix (so to speak) that positions and orients it appropriately in world space. If your object's origin is funny, then this matrix will have an extra translation component, or you could adjust the vertices after loading the 3D data in order to sanitize it.
- then multiply each object by the matrix that positions the camera at the world-space origin looking down -z. This matrix is the inverse of that which positions and orients the camera in world-space.
Whether you do the matrix multiplications in a vertex shader or using glMultMatrix/glPushMatrix/glPopMatrix/etc is up to you.
But start small with this stuff. Get it working with a cube or a glutTeapot before muddying the waters with object loading code.
How should I deal with something like projection matrix and glFrustrum?
[/quote]
Define a projection matrix. Decide on the field of view and near and far clip distances. gluPerspective can be a little easier to use in some situations. Again, the red book covers these functions in quite some detail. If you can rephrase your question in to something more specific, a better answer might be forthcoming.
How can I draw the quad (actually, two triangles), textured it, and ensure it's the background?
[/quote]
There are many ways. Perhaps set up an orthographic projection and use the identity for the modelview matrix. In this case the ±0.5*projection_width and ±0.5*projection_height of the projection give you the x and y coordinates of the quad's corners. A negative z value (say, -1) would be used. Ensure your orthographic projection is setup appropriately so that vertices at z=-1 aren't clipped.
The texturing chapter(s) in the red book will show you how to set up texturing.
Once that quad is drawn you probably want to clear the depth buffer using glClear(GL_DEPTH_BUFFER_BIT). Alternatively, you could disable depth writes while drawing the quad. Either way ensures that anything you draw afterwards will appear on top of the quad, as the usual depth test will always succeed.
show me the ideal workflow or maybe link me some accurate and deep paper
[/quote]
Really, that would be the Red book.