Question

I am writing a renderer plugin to 3ds max that is based on DirectX 11.

I am getting actual viewport matrix from 3ds max, that after inverting looks: [Rx Ry Rz] [Ux Uy Uz] [Dx Dy Dz] [Px Py Pz]

  • where R is for Right, U for Up, D id direction and P is Position.

I am applying this view matrix to DirectX (I am basing on rastertek tutorials: http://www.rastertek.com/dx11tut04.html) but instead of creating myself view matrix I am using this view matrix from 3ds max, which has basically the same structure: [Rx Ry Rz 0] [Ux Uy Uz 0] [Dx Dy Dz 0] [Px Py Pz 1]

At first everything seems ok, because the view in max viewport and the rendered view in DirectX window look almost the same. But the transformations in the max viewport and DirectX window are not the same. Is seems like: when I am moving camera position in max the camera target in DirectX is moving instead, and when I am moving camera target (or rotating camera) in max the camera position in DirectX is moving instead.

thanks for helping... I can't figure it out for 3 days...

Was it helpful?

Solution

I finnaly found the solution...

First, I took Up, Direction and Position from 3ds max matrix and manualy create the view matrix but using: D3DXMatrixLookAtRH and D3DXMatrixPerspectiveFovRH (for projection matrix) instead of D3DXMatrixPerspectiveFovLH and D3DXMatrixLookAtLH which solved most problems...

Then, I noticed that 3ds max matrix is not updated during panning the camera (only position was updated) so, for look at vector in view matrix I used "position-direction"...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top