Getting coordinates from a matrix
I have read that you can get the x,y,z coords from a matrix in the .__ position? How do you extract this data?
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."
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."
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
the cameraposition from a view matrix like that. Just so
you know! I''ve tried
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement