get mesh position

Started by
4 comments, last by MJP 15 years, 2 months ago
Hy. How i can find the position of a mesh in the word space? Is usefully for switch the camera closest to an object. thanks.
Advertisement
you would take the local matrix and multiply it with the world matrix I believe
can you post me a link or two lines of code?
thanks
up up
word space?
If you have a world matrix that you use to transform the mesh for rendering, then you can access the translation part of the matrix by pulling out the _41, _42, and _43 elements of the matrix. Those three components from the X, Y, and Z values of a vector representing the position where the mesh will be centered.

This topic is closed to new replies.

Advertisement