Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

peter86

Transforming coordinates

This topic is 5222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I transform the local coordinates of a vertex belonging to a mesh into global world coordinates?

Share this post


Link to post
Share on other sites
Advertisement
Multiply the transformation matrix with the coordinates.

[a b c][x]
[d e f][y]
[g h i][1]

Zorx (a Puzzle Bobble clone)
Discontinuity (an animation system for POV-Ray)

[edited by - clum on June 1, 2004 1:45:14 PM]

Share this post


Link to post
Share on other sites
Do you have the transformation matrix from the mesh to the world? That would be a 4x4 transformation matrix. The upper 3x3 block is rotation (and possibly scale), and the last row/column is translation. Just multiply the transformation matrix times the vertex to get the world space vertex, e.g.:

V_world_space = T * V_mesh_space

where T is the 4 x 4 mesh-to-world transformation matrix.

Graham Rhodes
Principal Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
Yes, I have the world transformation matrix.
I need both scaling and rotation etc. But which matrix components should I multipy with the x, y and z coordinates of the vertex? And what are those components for?

Share this post


Link to post
Share on other sites
quote:
Original post by clum
Sorry for this answer, but I really think you were asking for it: matrix multiplication


Nope, I was just looking for a way to transform the coordinates. The D3DXVec3TransformCoord function was what I was after, but thanks anyway

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!