Recommended Posts

Hi, i have been working with matrices for a while now, and i think i am beginning to understand them a lot better, but i have a problem with understanding the individual parts to a matrix. The specific parts i am refering to are, basically, what does each row/column of a matrix represent. From debugging i have found out that _41, _42, _43 are the position coordinates in world space (unless im wrong).
The reason why i am asking this is so that i can transform a normal vector(just a line or a shape) from world to model space and back again. Specifically, the mathematics behind this (ie. what parts of my existing vector do you multiply/add with what parts of a matrix).
A simple formula used for transforming a D3DXVECTOR3 using a 4x4 Matrix would be much appreciated.
Thanks for any replies.

Share this post

Link to post

Share on other sites

The SolutionObject Space : This is where your vertices are defined for your objectWorld Space : This locates your object in world space... the world that you work with. We go here from object space using a world transformation matrixView Space : Locates your camera in space and relocates your objects around your camera, we go here from world space using a view transformation matrix.Clip Space : This space basically clips your view frustum into a cube. Which gives the impression of perspective/depth etc.. We go here from view space using a projection transformation matrix.

Matrices are nice since we can jam alot of information in them.Translation matrix (Movement)1 0 0 00 1 0 00 0 1 0x y z 1and so forth...I would suggest reading this part of the DirectX SDK

It explains the transformations very well and how some of the math works.

Also, With regard to your second question.You want to transform a normal vector from world to model space. This is done using an inverse world transformation matrix. You could use the D3DXMatrixInverse Function and transform the vector by the resulting matrix using D3DXVec3Transform. Also if you want to transform a vector from model space to world space you could just transform the vector by the world transformation matrix.

I hope this helps a bit buddy. Take care. If you have any more questions. Please do not hestitate to ask.

0

Share this post

Link to post

Share on other sites

pX,pY,pZ is position in world space.Xx,Xy,Yx,Zy..... is how jour object will look in world space, if u put Xx=1, Yy=1,Zz=1 and others 0, u will get the same object as jour object in local space, try to manipulate these to get cool effects.