Sign in to follow this  

Math question

This topic is 3040 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

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by experiment
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)


The answer has already been given, but this is how to never forget about it:
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]

Share this post


Link to post
Share on other sites

This topic is 3040 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this