View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# How to get position relative to matrix???

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1Sincity328  Members

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

### #2ToohrVyk  Members

Posted 26 October 2003 - 07:57 AM

Multiply the point by the inverse of the matrix?

(Not sure if this is what you want, but here you are.)

### #3Sincity328  Members

Posted 26 October 2003 - 08:13 AM

Sorry to sound dumb but what function would multiplying a matrix be in dx? Or is that the same as multiplying the rows of the matrix by the point?

Thanks,
Maurice

### #4ToohrVyk  Members

Posted 26 October 2003 - 09:00 AM

D3DXVec3TransformCoord( )

### #5python_regious  Members

Posted 26 October 2003 - 11:14 AM

If you have the new frame and the point in the same frame of reference, then just multiply the point by the frame ( 4x4 matrix ).

You have to remember that you''re unique, just like everybody else.

### #6Sincity328  Members

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

### #7SpaceDude  Members

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)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.