Active viewport view matrix to DirectX view matrix - strange problem...

Active viewport view matrix to DirectX view matrix - strange problem...

Anonymous
Not applicable
465 Views
1 Reply
Message 1 of 2

Active viewport view matrix to DirectX view matrix - strange problem...

Anonymous
Not applicable
Hi,
I've been working on this issue for 2 days already and I can't figure out
what is wrong:

01. I am taking current view matrix (camera or perspective) from 3ds max and Inverting it.
So now I have 4 rows by 3 columns matrix, where R is for Right, U is for Up, D is for direction and P is the position, I printed out the values and visualize the vectors and everything is OK:





02. The problem begins when I use this matrix as view matrix in DirectX 11,
which is almost the same:





03. 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.

can't figure it out... (?)
0 Likes
466 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
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"...
0 Likes