Hi, I have models being loaded and drawn without a problem… with single mesh instances, from an XYZ location, I have models with multiple meshes now, and I need to be able to provide a reference to the XYZ location of each mesh within the model.
I’ve tried accessing the Matrix information for the mesh, but I get GL_MODELVIEW_MATRIX, which for some reason each time,… is a camera. Am I going the right way with this… to get the coordinates of the Mesh location in the screen coordinates… or do I have to do it another way…
Querying OpenGL to retrieve matrices is not generally considered to be the best way of tracking the objects in applications for performance reasons, amongst others. It is better to track their position yourself - after all, in order to draw correctly, your application must have told GL where the objects were in the first place.
I assume you aren’t tracking the objects separately yourself (getting their positions would be trivial if so) and that they are defined in the scene format that you are using. If so you should try to retrieve them from here. In our own model format, POD, you would call a function like getWorldMatrix() on the mesh’s SPODNode, for instance. This should allow you to locate the meshes in world space.
To get their position in 2D screen space from this then you will need to apply a perspective calculation to the position described by the world matrices as well.
Are you actually wanting screen-space positions? What scene format are you using? Is it POD?
I hope this helps and I haven’t misunderstood your question.