Page 1 of 1

Cant rotate a mesh

Posted: Wed Jan 20, 2010 8:07 am
by humbrol
Im using arrays cockpit flight controls to control the node and make the camera and heres the node setup info

Code: Select all

 IAnimatedMesh* mesh = smgr->getMesh("../../media/shuttle/shuttle9.3ds");
        if (!mesh)
        {
                device->drop();
                return 1;
        }
        IAnimatedMeshSceneNode* node1 = smgr->addAnimatedMeshSceneNode( mesh );
       if (node1)
        {
                node1->setMaterialFlag(EMF_LIGHTING, false);
                node1->setScale(vector3df(.005,.005,.005));
                node1->setRotation(vector3df(0,-90,0));

                       }

no matter how i change the setRotation, the model stays facing the same direction,, it moves and flies correctly, just the model isnt orientated correctly. any tips?


plus in my workings with arras flight controls it appears the camera is the object moved and the node is moved around the camera, is there a way to get the controls to control the node and the camera to follow?

Posted: Thu Jan 21, 2010 12:51 pm
by Mux
Maybe you could try:

Code: Select all

node1->setRotation(vector3df(0,node1->getRotation().Y-90,0)); 

Posted: Fri Jan 22, 2010 1:13 am
by vitek
It sounds like the mesh isn't aligned with the correct coordinate system. If you open the mesh up in an editor, you want Y up and Z forward. You can fix this with code, but it is much easier to just use an editor.

Travis