Quark
24-04-2007 13:39:43
I have 1 large 3DSMax model which consists of roughly 10 groups. I have exported the .osm scene with the oFusion CE, resulting in 10 defined scenenodes in the .osm file.
I'm having trouble getting the osceneloader to work, but since it's basically just a XML parser which reconstructs the scene I am not too bothered with this, I'll just create the 10 scenenodes by hand. I am trying to use the data in the .osm file to do this.
I am creating my scenenode tree like this, for 2 example nodes:
The position and scale factors seem to work well, however the orientation is not. The nodes are rotated a bit, not aligned at all. I have taken care to follow the correct w,x,y,z order of the argument for setOrientation.
Could someone point me to my mistake? If necessary I can provide a screenshot of the misaligned objects.
I'm having trouble getting the osceneloader to work, but since it's basically just a XML parser which reconstructs the scene I am not too bothered with this, I'll just create the 10 scenenodes by hand. I am trying to use the data in the .osm file to do this.
I am creating my scenenode tree like this, for 2 example nodes:
Entity *entity;
SceneNode *currnode;
currnode = rootnode->createChildSceneNode("nodeName1");
entity = mSceneMgr->createEntity("entName1", "mesh1.mesh");
currnode->setPosition(-0.216241, 111.451, -9.23888);
currnode->setOrientation(-0.707107, -1.51827e-008, 0, 1.52092e-008);
currnode->scale(4.03114, 4.03114, 4.2327);
currnode->attachObject(entity);
currnode = rootnode->createChildSceneNode("nodeName2");
entity = mSceneMgr->createEntity("entName2", "mesh2.mesh");
currnode->setPosition(-17.6109, 109.508, 0.534357);
currnode->setOrientation(-0.712495, -0.0207519, -0.0156086, 0.043366);
currnode->scale(0.362807, 0.35461, 0.364357);
currnode->attachObject(entity);
The position and scale factors seem to work well, however the orientation is not. The nodes are rotated a bit, not aligned at all. I have taken care to follow the correct w,x,y,z order of the argument for setOrientation.
Could someone point me to my mistake? If necessary I can provide a screenshot of the misaligned objects.