• Advertisement
Sign in to follow this  

Hi, correct exports from max, but the scene isn't maximized

This topic is 2087 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

Isn't that the viewport in 3ds exactly the same as the one of the viewports in max? if so, then the dx viewport only can be as large as one of the 4 viewports in max?
which must be smaller because max viewport cannot occupy the whole screen....

Share this post

Link to post
Share on other sites
Camera Conversion method

FILE* fpc;
fpc = fopen("Output\\Demo.cam", "wb");
float fov, aspectRatio, nearClip, farClip;
Matrix3 posM, target;
CameraState cs;
CameraObject *cam = (CameraObject*) aNode->EvalWorldState(ip->GetTime()).obj;

cam->EvalCameraState(ip->GetTime(), FOREVER, &cs);
posM = aNode->GetObjectTM(ip->GetTime(), 0);
aNode->GetTargetTM(ip->GetTime(), target);
/*posM = posM * matD3D;
target = target * matD3D;*/
Point3 row1 = posM.GetRow(1);
Point3 row2 = posM.GetRow(2);
Point4 col1 = posM.GetColumn(1);
Point4 col2 = posM.GetColumn(2);
posM.SetRow(1, row2);
posM.SetRow(2, row1);
posM.SetColumn(1, col2);
posM.SetColumn(2, col1);
row1 = target.GetRow(1);
row2 = target.GetRow(2);
col1 = target.GetColumn(1);
col2 = target.GetColumn(2);
target.SetRow(1, row2);
target.SetRow(2, row1);
target.SetColumn(1, col2);
target.SetColumn(2, col1);

fov = cam->GetFOV(ip->GetTime(), FOREVER);

aspectRatio = ip->GetRendImageAspect();
// Change it to vertical 3d mathematic book
float e = 1 / tanf( fov / 2 );
// vertical fov
fov = 2 * atanf(aspectRatio/e);

nearClip = cam->GetClipDist(ip->GetTime(), CAM_HITHER_CLIP, FOREVER);
farClip = cam->GetClipDist(ip->GetTime(), CAM_YON_CLIP, FOREVER);
write_cam_file(fpc, posM, target, fov, aspectRatio, farClip, nearClip);

Share this post

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

  • Advertisement