# Math question

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

## Recommended Posts

How can I get object's vertice position in global coordinate if I have the local vertice position and object's matrix pose? I need to get it in vector format (x, y, z)

##### Share on other sites
global = transform*local

Should work, assumes the transform changes from local space to work space which I guess it does do fromy our pose.

##### Share on other sites
So: (Vector i'm looking for) = (Local vector) * (transform matrix) ?

##### Share on other sites
a vertex from object space can move into world-global space by being multiplied by the object's world matrix. it is matrix of the object that the vertex belongs to. If this vertex is from object's object space, then the object's world matrix will move it to the world space . And yes it is worldvertex=(object's world matrix)*(vertex from object space).

##### Share on other sites
Also note that if you have nested transformation matrices, make sure you multiply them in the correct order.

MatA * MatB * vector != MatB * MatA * vector

##### Share on other sites
Quote:
 So: (Vector i'm looking for) = (Local vector) * (transform matrix) ?

More like

(Vector i'm looking for) =(transform matrix)*(Local vector)

You have to premultiply vectors to transform them, remember? In homogeneous coordinates, the transformation matrix will be a 4x4 matrix, so you'll get a 4 component vector in return

##### Share on other sites
Quote:
 Original post by experimentHow can I get object's vertice position in global coordinate if I have the local vertice position and object's matrix pose?I need to get it in vector format (x, y, z)

the local matrix columns form a vectorial basis..When you add the center of the geometrical object to which that matrix is attached, you have a coordinate system. You certainly already know it.
Let's A be a "local" matrix.

    |a11 a12 a13|A = |a21 a22 a23|    |a31 a32 a33|

So, the vectors forming the object's basis are

v1 = tranpose( |a11 a21 a31| )v2 = transpose( |a12 a22 a32| )v3 = ...

When you multiply A "by" va = transpose( |1 0 0| ), you obtain

vb = tranpose( |a11 a21 a31| )

the first colum of A, which is the first vector of the basis expressed in world coordinates. You've just mapped the local x-axis, va, into the first vector of the basis...Both are the same vector, but expressed in different coordinate systems.

Hence when you multiply a vector by the matrix A, you're computing its world coordinates, since the vectors of the basis A are given in world coordinates...Otherwise A would be equal to the identity matrix for every object, which would be a complete nonsense.

You just have to fully grasp what the columns of a matrix represent, and what the result of the product A * transpose( |1 0 0| ) means to never forget what you should do to go from one coordinate system to another.

P.S: you should easily be able to apply that reasonning when vectors are defined as row-vectors.

[Edited by - johnstanp on August 21, 2009 8:22:50 AM]

1. 1
Rutin
25
2. 2
3. 3
JoeJ
19
4. 4
5. 5

• 10
• 11
• 9
• 9
• 10
• ### Forum Statistics

• Total Topics
631753
• Total Posts
3002098
×