Sign in to follow this  

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

Recommended Posts

I have correctly exported a scene from max, but there are a lot white spaces about the main object.
I think there is something to do with window size.


Jack Edited by lucky6969b

Share this post

Link to post
Share on other sites
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\\", "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

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