dreamig
12-02-2014 09:57:19
HI,
my aim is to use ogreprocedural and .skeleton file to create my character
with cylinders
for that first i ake like that
for all the bones of the .skeleton
where the function "create_joint_list" tend to create shapes (cylinder) for the arm,legs...
we give the first bone, the father bone, the name and the cylinders ruduis
Now in create_joint_list i make like that
the problem is in thsi line
Because for the bones there is not create childscenode;
my aim is to use ogreprocedural and .skeleton file to create my character
with cylinders
for that first i ake like that
for all the bones of the .skeleton
create_joint_list(skel->getBone(i)->getParent(),skel->getBone(i),30.5,skel->getBone(i)->getName());
where the function "create_joint_list" tend to create shapes (cylinder) for the arm,legs...
we give the first bone, the father bone, the name and the cylinders ruduis
Now in create_joint_list i make like that
Ogre::Vector3 from = start->_getDerivedPosition()/*getPosition()*/;
Ogre::Vector3 to = end->/*getPosition()*/_getDerivedPosition();
Ogre::Real Length = from.distance( to );
cout<<"length"<<length;
Ogre::Real height = Length - 2*40;
Procedural::CapsuleGenerator().setRadius(40).setHeight(height).setPosition(0,Length/2,0).realizeMesh(nom);
Ogre::Entity* ent2 = mSceneMgr->createEntity(nom);
ent2->setMaterial(material3);
Ogre::SceneNode* sn =start->createChildSceneNode();
material = Ogre::MaterialManager::getSingleton().create("green"+nb_cam, "General");
material->getTechnique( 0 )->getPass( 0 )->setAmbient(0.5,0.5,0.5);
/*ent_marker*/ent2->setMaterial(material);
sn->attachObject(ent2);
sn->_setDerivedOrientation( Ogre::Vector3::UNIT_Y.getRotationTo( to-from ) );
nb_cam++;
////////////////
}
the problem is in thsi line
Ogre::SceneNode* sn =start->createChildSceneNode();
Because for the bones there is not create childscenode;