#### Archived

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

# Transforming coordinates

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

## Recommended Posts

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

##### Share on other sites
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 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 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 on other sites
Sorry for this answer, but I really think you were asking for it: matrix multiplication

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

##### 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

1. 1
Rutin
67
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633420
• Total Posts
3011791
• ### Who's Online (See full list)

There are no registered users currently online

×