#### Archived

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

# Getting coordinates from a matrix

This topic is 6197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have read that you can get the x,y,z coords from a matrix in the .__ position? How do you extract this data?

##### Share on other sites
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 on other sites
That is true for a translation-matrix. But, you can''t get
the cameraposition from a view matrix like that. Just so
you know! I''ve tried

##### 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)

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631740
• Total Posts
3001962
×