Hi - here are my Facts / Assumtions / and finally a Conclusion (which is actually more like a question):
Fact 1) When manipluating the modelview matrix, any verticies subsequently drawn will be transformed to their appropriate world / view / screen destination. Fine.
Assumtion 1) Although it transforms the vertexs, OpenGL does not provide any direct way of returning the world location of any given local vertex after transforming it (for the purpose of collision detection, or other needs) - True?
Assumtion 2) Given that Assumtion 1) is correct, this means that all systems using OpenGL for rendering must still maintian their own Matrix classes for handling their Scene Graph calculations, which would involve knowing the world coord of a local mesh vertex (after model transformations). Ok.
Conclusion 1) I just use OpenGL’s perspective transformations alone, and instead of using glRotate() and other model transformations, use my own Matrix class to transform a meshes local vertex coord to it’s world space location, then draw it with OpenGL? This way, since I need to have a multiplied matrix ready for the model (to handle collision etc), I might as well compute it per-frame just before passing OpenGL the world coord. Doesn’t this save 2 different set’s of matrixes doing part of the same stuff?
In Other words) Is is good practice to just use OpenGL’s perspective transformations (just to transform world verticies to view space), and use your own matrix to transform your meshes to their world space coords (then draw those world space coords directly), thus eliminating the need to use any subsequent OpenGL model transformations?
- Thanks, it sounds good to me. But what do you guys do?