Jump to content
  • Advertisement
Sign in to follow this  

3DSMax and camera export

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

hi guys! i try to export the camera animation (translate , scale and rotation) from 3dSMax60 , i use this code void RecursiveNode(INode *node,FILE *fp ,TimeValue time){ if(node->Selected()) { ObjectState os = node->EvalWorldState(0); if (os.obj) { fprintf(fp,"%s", node->GetName()); if(IsNodeValid(node, LOOKAT_CAM_CLASS_ID)){ int count = 0; CameraObject *cam = (CameraObject*)node->EvalWorldState(time).obj; // convert vertex from 3dsmax format. Matrix3 tm = node->GetNodeTM(time); Point3 p3 = tm.GetTrans(); float yaw = 0.0f; float pitch = 0.0f; float roll = 0.0f; tm.GetYawPitchRoll(&yaw,&pitch,&roll); fprintf(fp,"TransalteX:%f\n",p3.x); fprintf(fp,"TransalteY:%f\n",p3.y); fprintf(fp,"TransalteZ:%f\n",p3.z); fprintf(fp,"Rotation Yaw:%f\n",yaw); fprintf(fp,"Rotation Pitch:%f\n",pitch); fprintf(fp,"Rotation Roll:%f\n",roll); } } } } so , when i see the file , the data are al the same , here is when i call the RecursiveNode(....) int tpf = GetTicksPerFrame(); int s = i->GetAnimRange().Start()/tpf, int e = i->GetAnimRange().End()/tpf; //for each frame for (int f = s; f <= e; f++) { fprintf(fp,"-----%d------\n",f); for (int idx=0; idx<numChildren; idx++) { if (i->GetCancel()) break; //RecursiveNode(i->GetRootNode()->GetChildNode(idx),fp ,i->GetTime()); RecursiveNode(i->GetRootNode()->GetChildNode(idx),fp ,f); } fprintf(fp,"-----------\n"); }// for frames any one figure out why i can get the trasformation data for each frame ? ( i get all the same transformation value each frame:( )

Share this post

Link to post
Share on other sites
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!