# How to get position relative to matrix???

Started by Oct 26 2003 07:46 AM

,
6 replies to this topic

###
#1
Members - Reputation: **122**

Posted 26 October 2003 - 07:46 AM

I was wondering if any could help me with finding the position of a point based on a matrix?? In other words i want to translate the point into the coordinate system of the matrix so that the matrix is origin/aligned x,y,z and the point is based on the matrix not on the world matrix. In directx 7 you could get position relative to another object, that is what im trying to do but in dx8.
Any help or suggestions are much appreciated!
Thanks,
Maurice

###
#6
Members - Reputation: **122**

Posted 27 October 2003 - 09:40 AM

I got the inverse of the matrix , then used the vec3TransformCoord function but as the matrix was rotated the output stayed the same. Shouldn''t the relative position change if a matrix is rotated (Point to the left of the matrix when rotated left can be come a Point in front of the matrix)???

Thanks,

Maurice

Thanks,

Maurice

###
#7
Members - Reputation: **208**

Posted 27 October 2003 - 10:28 AM

if you just want to move your points without any what not... then you can simple add the coordinates of the point to the origin of your second coordinate system...

i.e.

point (x, y, z)

second coordinate origin (X, Y, Z)

the new coordinates of your point will be (x+X, y+Y, z+Z)

i.e.

point (x, y, z)

second coordinate origin (X, Y, Z)

the new coordinates of your point will be (x+X, y+Y, z+Z)