Sign in to follow this  

Need guidance to convert between D3D and max cameras

Recommended Posts

So far what I've done in my code base is bogus (as the Camera conversion part goes)
I have tried to convert a Max camera by transforming it with
1.0 0.0 0.0
0.0 0.0 1.0
0.0 1.0 0.0
0.0 0.0 0.0
But still there is discrepancy. The Camera just hangs lower and part of the main object went out of sight. Actually I have downloaded the guidance page called "How to convert a 3ds max camera to a Direct3D camera" (One of you guys helped me with this). However, I had a problem that the API
GraphicWindow::GetCameraMatrix never returns, just freezes upon calling that method and going nowhere. Are there still any good sources on the web about this kind of info in existence?

CameraObject *cam = (CameraObject*) aNode->EvalWorldState(ip->GetTime()).obj;
CameraState cs;
cam->EvalCameraState(ip->GetTime(), FOREVER, &cs);

Matrix3 atm = aNode->GetObjectTM(ip->GetTime(), 0);// 4x3 matrix
Matrix3 targetTM;
aNode->GetTargetTM(ip->GetTime(), targetTM);

Matrix3 matD3D;
Point3 p1 (1.0f, 0.0f, 0.0f);
Point3 p2 (0.0f, 0.0f, 1.0f);
Point3 p3 (0.0f, 1.0f, 0.0f);
Point3 p4 (0.0f, 0.0f, 0.0f);

matD3D.SetRow(0, p1);
matD3D.SetRow(1, p2);
matD3D.SetRow(2, p3);
matD3D.SetRow(3, p4);

targetTM = targetTM * matD3D;

atm = atm * matD3D;
float fov = cs.fov;
WriteCam_File(atm, targetTM, fov);


View in max

Actual View:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this