hi all
I need to change the view matrix to scale world space by -1 in the z-direction.
To do this, i need to flip the sign of the _31, _32, _33, and _34 member of the D3DMATRIX structure of view matrix.
i think i need to do something like this
core::matrix4 viewMatrix = driver->getTransform(video::ETS_VIEW);
viewMatrix[2] = viewMatrix[2] * -1;
viewMatrix[6] = viewMatrix[6] * -1;
viewMatrix[10] = viewMatrix[10] * -1;
viewMatrix[14] = viewMatrix[14] * -1;
or
viewMatrix[8] = viewMatrix[8] * -1;
viewMatrix[9] = viewMatrix[9] * -1;
viewMatrix[10] = viewMatrix[10] * -1;
viewMatrix[11] = viewMatrix[11] * -1;
driver->setTransform(video::ETS_VIEW,viewMatrix);
but I am not sure that is the correspondence in the irrlicht matrix to the D3D matrix, the first (2,6,10,14) or (8,9,10,11)
if some one can help me with this
thanks in advance =)
how to scale world space -1 in z direction !?
Re: how to scale world space -1 in z direction !?
to make it simple can some tell me how the matrix4 is build
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
I need this so I can access the 3º Row
ty
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
I need this so I can access the 3º Row
ty
Re: how to scale world space -1 in z direction !?
Irrlicht uses row major matrices, which means that their layout in memory is:
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
so your third row is the range from 8 to 11. The Irrlicht matrices are compatible with DirectX.
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
so your third row is the range from 8 to 11. The Irrlicht matrices are compatible with DirectX.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt