• Advertisement
Sign in to follow this  

Need guidance to convert between D3D and max cameras

This topic is 2402 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement