I want to match 1:1 the 3ds max camera render with my 3d engine (DirectX 11, C++).
I believe that my mesh exporter (coded with
MaxScript) works fine, I see the right shapes.
But something about the perspective, translation (of the camera) and/or rotation is not quite right - the scene looks similar, but not the same:
As you can see:
- the window proportion and size is ok,
- the mesh looks fine (I'm not interested with the materials or shading now, just the 1:1 match of view & perspective),
- to get the better match, I had to translate the window (as you can see on the second image, the corner of one has some offset),
- the rotation or rather perspective seems to be a bit wrong (note the smaller teapot on second image).
I guess I've missed something:
- My object and camera are places in the same position as in 3ds max (3ds max is set to millimeters, engine don't use any units - e.g. camera is at
[20mm, 10mm, 0mm]in 3ds max and
[20, 10, 0]in game engine).
- Game engine camera uses
DirectX::XMMATRIX projection = DirectX::XMMatrixPerspectiveFovLH(DirectX::XM_PIDIV2, screenWidth / (FLOAT)screenHeight, 0.01f, 1000.0f);and the 3ds max camera is set to
FOV = 90:
- The position and orientation of the object and camera (camera has no rotation applied) are converted from 3ds max right-handed z-up coordinate system to engine's left-handed y-up coordinate system. The orientation is expressed in quaternion and it's transformed from one system to another with:
temp = q.z q.z = q.y q.y = temp q.z = -q.z q.x = -q.x q.y = -q.y
What did I miss and should take into account when matching game engine view with 3d edition software like 3ds max?