Hi All,
I have a 3DS model with JPG texture that I am loading into OF 006 via the ofx3DModelLoader addon.
It looks lovely:
[attachment=2:xqzfbktl]completeModel.jpg[/attachment:xqzfbktl]
I have also had the model broken up in to parts so that I can animate each bit individually within OF - scaling the mouth and moving the hat etc. Unfortunately, I haven’t been able to get the co-ordinate system from Cheetah 3D (http://www.cheetah3d.com/) (where it was modelled) to line up with the OF openGL co-ordinate system. Especially strange as Cheetah 3D also uses OpenGL for its positioning.
[attachment=1:xqzfbktl]modelInParts.jpg[/attachment:xqzfbktl]
The positioning of the objects in Cheetah3D is as follows:
[attachment=0:xqzfbktl]allPartsTogetherPos.jpg[/attachment:xqzfbktl]
I have positioned my separate objects in the same way as the complete model:
float xPos = ofGetWidth()/2.f;
float yPos = ofGetHeight()/2.f;
float zPos = 0.f;
wizardModelEyes.setRotation(0, 180, 1, 0, 0);
wizardModelEyes.setPosition(xPos+9.354f, yPos+6.271f, zPos +0.f); //see EYES.PNG from Cheetah 3D
wizardModelEyes.setScale(4, 4, 4); //is scaling OK?
wizardModelHat.setRotation(0, 180, 1, 0, 0);
wizardModelHat.setPosition(xPos+0.f, yPos+7.636f, zPos +0.f); //see HAT.PNG from Cheetah 3D
wizardModelHat.setScale(4, 4, 4); //is scaling OK?
wizardModelHead.setRotation(0, 180, 1, 0, 0);
wizardModelHead.setPosition(xPos+0.f, yPos+11.696f, zPos +0.f); //see HEAD.PNG from Cheetah 3D
wizardModelHead.setScale(4, 4, 4); //is scaling OK?
wizardModelMouth.setRotation(0, 180, 1, 0, 0);
wizardModelMouth.setPosition(xPos+0.f, yPos+7.636f, zPos +0.f); //see MOUTH.PNG from Cheetah 3D
wizardModelMouth.setScale(4, 4, 4); //is scaling OK?
vs.
wizardModel.setRotation(0, 180, 1, 0, 0);
wizardModel.setPosition(ofGetWidth()/2, ofGetHeight()/2, 0);
wizardModel.setScale(4,4,4);
But the positions are coming out completely wrong. How do I marry the two co-ordinate systems so I can animate relative scale and position?
You can find both OSX OF 006 projects to download below:
http://dl.getdropbox.com/u/370155/OFChe-…-eModel.zip
(Complete with Cheetah ScreenGrabs and the like)
and
http://dl.getdropbox.com/u/370155/OFChe-…-Models.zip
(Just the broken up model)
Cheers,
JGL