Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Need guidance to convert between D3D and max cameras

This topic is 2588 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
[source]
Matrix3
1.0 0.0 0.0
0.0 0.0 1.0
0.0 1.0 0.0
0.0 0.0 0.0
[/source]
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
http://imageshack.us/photo/my-images/5/originalview.jpg/

Actual View:
http://imageshack.us/photo/my-images/805/actualview.jpg/
Thanks
Jack

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!