B3d format and animation
B3d format and animation
I got a B3d animated model into a test app with the new irrlicht 1.1 b3d loader however I don't see a getB3DJointNode function. I see a getXJointNode and a getMS3DJointNode.
I have looked at a b3d file in a hex editor and I believe the join name information is in the b3d file but is not being set to the node name when the file is loaded by the b3d loader. I see the joint name strings embedded in the file, single byte chars not wide or unicode.
I tried to write my own node finder that would traverse a node tree looking for a specified name but all the node names were set to empty string.
Any suggestions how I could get a pointer to the hand node on a b3d loaded mesh?
I have looked at a b3d file in a hex editor and I believe the join name information is in the b3d file but is not being set to the node name when the file is loaded by the b3d loader. I see the joint name strings embedded in the file, single byte chars not wide or unicode.
I tried to write my own node finder that would traverse a node tree looking for a specified name but all the node names were set to empty string.
Any suggestions how I could get a pointer to the hand node on a b3d loaded mesh?
Thanks Luke. I did a SVN checkout last night. However, I didn't have the directx SDK installed so I couldn't compile it. The SDK is installing right now so I will be able to compile irlicht shortly. I'm glad to hear that the function to get the joint is in there. When I did the check out last night I was thinking I was going to have to root around in the B3D loader and add it myself.
Maybe instead of all these separate Get[modeltype]JointNode() functions we should have a virtual function named GetJointNode in the parent class and have it defined in each of the subclasses. For default the virtual function could give the nodes generic text names like "node1"...node2...node3... node5 for those model types that don't have any joint name information in the model file.
Maybe instead of all these separate Get[modeltype]JointNode() functions we should have a virtual function named GetJointNode in the parent class and have it defined in each of the subclasses. For default the virtual function could give the nodes generic text names like "node1"...node2...node3... node5 for those model types that don't have any joint name information in the model file.
Yeah I agree,
There could simply be a function GetJointNode that calls GetXJointNode, GetB3dJointNode, getMS3DJointNode based on the type of mesh it is. But this is an interface thing so it’s probably more for the Irrlicht team. but this would be cool, and wouldn’t break any code if the old functions are kept.
There could simply be a function GetJointNode that calls GetXJointNode, GetB3dJointNode, getMS3DJointNode based on the type of mesh it is. But this is an interface thing so it’s probably more for the Irrlicht team. but this would be cool, and wouldn’t break any code if the old functions are kept.
You wouldn't need to worry about figuring out what type of model it is to implement a GetJointNode. If it was in the base class and defined in the child classes then it would be called polymorphicly from a pointer to the base class. Although, you are right, it should be done by the person in charge of the base classes.
If you put a patch together I'd be interested in it also. The SVN version works for me as far as the b3d files go but it broke the 3rd person camera I've been using. In fact the SVN version breaks ALL the user coded cameras I've found except the built in FPS and MAYA cams.
They have made some changes to the way events and view frustums are done.
If you put a patch together I'd be interested in it also. The SVN version works for me as far as the b3d files go but it broke the 3rd person camera I've been using. In fact the SVN version breaks ALL the user coded cameras I've found except the built in FPS and MAYA cams.
They have made some changes to the way events and view frustums are done.
getB3DJointNode is now just getJointNode
this might also be helpful http://www.irrlicht3d.org/wiki/index.ph ... tionSystem
this might also be helpful http://www.irrlicht3d.org/wiki/index.ph ... tionSystem
thanks for the answer and for the site!
but still have problem:
it dies with access violation... at the first line..
whatever i put to first, it dies, when it comes to joint.. why? should i init something before it? (the node is loaded)
edit: ohh i'm sorry, my fault.. ^^; i forgot that i loaded the model to tmp, and placed to "model" after that.. ^^; it doesn't crash now, however, a little funny but i think, i can do it from now. thank you!^^
but still have problem:
Code: Select all
model->node->setJointMode(EJUOR_READ);
weapon = Game.smgr->addAnimatedMeshSceneNode(Game.smgr->getMesh("katana.b3d"));
IBoneSceneNode *connect = model->node->getJointNode("katana");
connect->addChild(weapon);
whatever i put to first, it dies, when it comes to joint.. why? should i init something before it? (the node is loaded)
edit: ohh i'm sorry, my fault.. ^^; i forgot that i loaded the model to tmp, and placed to "model" after that.. ^^; it doesn't crash now, however, a little funny but i think, i can do it from now. thank you!^^
hi!
still have a problem..
it's successfully attachet to the joint (weapon to the hand), but when i'm moving my character, then the weapon is slow.
so, when i'm forwarding, the weapon comes after my character, but slowly (not same as my chara).
but when i stop, it slowly returns to the charas hand..
how can i do that it go at the SAME speed?
and an other question:
i can make that my model connects to a joint. so, my weapons 0,0 goes to my characters joint. but can i do that joint connets to joint?
so
for example for long weapons, when i have to place my characters hand. but the place is different for other weapons.
can i do it?
still have a problem..
it's successfully attachet to the joint (weapon to the hand), but when i'm moving my character, then the weapon is slow.
so, when i'm forwarding, the weapon comes after my character, but slowly (not same as my chara).
but when i stop, it slowly returns to the charas hand..
how can i do that it go at the SAME speed?
Code: Select all
weapon_models[0] = Game.smgr->getMesh("katana.b3d");
weapon = Game.smgr->addAnimatedMeshSceneNode(weapon_models[0]);
weapon->setPosition(vector3df(0,0,0));
hand = tmp->node->getJointNode("katana_start");
hand->addChild(weapon);
Code: Select all
void CGame::Render()
{
driver->beginScene(true, true, video::SColor(0,220,220,255));
player->UpdateJoints();
// render the scene
smgr->drawAll();
Code: Select all
void Player::UpdateJoints()
{
model->node->animateJoints();
weapon->animateJoints();
weapon->setRotation(vector3df(0,-90,0));
weapon->setPosition(model->node->getJointNode("katana_start")->getPosition());
}
i can make that my model connects to a joint. so, my weapons 0,0 goes to my characters joint. but can i do that joint connets to joint?
so
Code: Select all
weapon = Game.smgr->addAnimatedMeshSceneNode(weapon_models[0]);
weapon->setPosition(vector3df(0,0,0));
middle = weapon->getJointNode("katana_middle");
hand = tmp->node->getJointNode("katana_start");
hand->addChild(middle);
can i do it?
why do you have this code:
if the weapon is already parented?
and not sure what you mean with the other question.
Code: Select all
weapon->setRotation(vector3df(0,-90,0));
weapon->setPosition(model->node->getJointNode("katana_start")->getPosition());
and not sure what you mean with the other question.
ohh, the position setting is unuseful.. just i was trying to correct the problem..
and the rotation is because... the weapons rotation is different from the joint. so when i put the weapon to his hand, then it draws to right.. it's my fault (because my model should be rotated), but this doesn't have relation to my problem (it's bad when i don't use that too)
and the other question...
i want to connect two joints from two different models.
i can connect model to joint, but can i connect joint to joint?
and the rotation is because... the weapons rotation is different from the joint. so when i put the weapon to his hand, then it draws to right.. it's my fault (because my model should be rotated), but this doesn't have relation to my problem (it's bad when i don't use that too)
and the other question...
i want to connect two joints from two different models.
i can connect model to joint, but can i connect joint to joint?