Archived

This topic is now archived and is closed to further replies.

Getting coordinates from a matrix

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

The x,y,z are in the 4 row, columns 1,2, and 3, respectively

example in a D3DXMATRIX tempmatrix;
x = tempmatrix._41;
y = tempmatrix._42;
z = tempmatrix._43;


ta-da!

Pactuul

"The thing I like about friends in my classes is that they can''t access my private members directly."



Share this post


Link to post
Share on other sites
A matrice represent a function (a linear function). The goal of your position matrice is to transform some coordinates (the one of your model) into other coordinates (the one that you will show). To get the image''s coordinates of a point, you just have to multiply the matrice by the point.

So, what do you mean by ''coordinate of position matrice'' ?
I think that your model is centered in (0,0,0) and that you want to know where will be the center when it''ll be rendered. The answer is Position*(0,0,0) (or Position*(0,0,0,1) because the vector have 4 coordinates with DirectX)

Share this post


Link to post
Share on other sites