B3d format and animation
well, i tried to debug it but i didn't find anything wrong..
i don't know what's going on. if i draw the parts, but don't make it to child, then it's working...
I put up the source the exe and the other files, so if you have some time, please take a look at it please.. ><;
http://dotdotdot.extra.hu/FTP/model_viewer.rar
i don't know what's going on. if i draw the parts, but don't make it to child, then it's working...
I put up the source the exe and the other files, so if you have some time, please take a look at it please.. ><;
http://dotdotdot.extra.hu/FTP/model_viewer.rar
maybe this is crazy but it works for now!
if i can't use childs then i thought that i'll make a code for animating it...
well, just with rotation, it's working, i dunno what will be with the animations (i'll test out later)
if i can't use childs then i thought that i'll make a code for animating it...
well, just with rotation, it's working, i dunno what will be with the animations (i'll test out later)
Code: Select all
void UpdateJoints()
{
rhand->setPosition(jrHand->getAbsolutePosition());
lhand->setPosition(jlHand->getAbsolutePosition());
rarm->setPosition(jrArm->getAbsolutePosition());
larm->setPosition(jlArm->getAbsolutePosition());
head->setPosition(jHead->getAbsolutePosition());
torso->setPosition(jTorso->getAbsolutePosition());
vector3df vrot = jTorso->getRotation();
CMatrix4<f32> m = jTorso->getAbsoluteTransformation();
m.transformVect(vrot);
torso->setRotation(m.getRotationDegrees());
vrot = jHead->getRotation();
m = jHead->getAbsoluteTransformation();
m.transformVect(vrot);
head->setRotation(m.getRotationDegrees());
vrot = jrArm->getRotation();
m = jrArm->getAbsoluteTransformation();
m.transformVect(vrot);
rarm->setRotation(m.getRotationDegrees());
vrot = jlArm->getRotation();
m = jlArm->getAbsoluteTransformation();
m.transformVect(vrot);
larm->setRotation(m.getRotationDegrees());
vrot = jlHand->getRotation();
m = jlHand->getAbsoluteTransformation();
m.transformVect(vrot);
lhand->setRotation(m.getRotationDegrees());
vrot = jrHand->getRotation();
m = jrHand->getAbsoluteTransformation();
m.transformVect(vrot);
rhand->setRotation(m.getRotationDegrees());
}
doesn't working with newton ><; it's too slow...
i downloaded irrlich 1.4 again, maybe there is something...
if i use the dll, which is on it (didn't compile) then it goes with 450 FPS! not 100!
and if i compile it, then it goes to 100 FPS..
and i have a problem too:
it says scaleData is used without being initialised..
maybe this is the problem? i'm did that:
but the filesize is different too.
if i compile, it's 3,48 MB. if i use the old, it's 2,02...
i downloaded irrlich 1.4 again, maybe there is something...
if i use the dll, which is on it (didn't compile) then it goes with 450 FPS! not 100!
and if i compile it, then it goes to 100 FPS..
and i have a problem too:
Code: Select all
bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *InJoint)
{
s32 flags;
file->read(&flags, sizeof(flags));
#ifdef __BIG_ENDIAN__
flags = os::Byteswap::byteswap(flags);
#endif
while(B3dStack.getLast().startposition + B3dStack.getLast().length>file->getPos()) //this chunk repeats
{
s32 frame;
f32 positionData[3];
f32 scaleData[3];
f32 rotationData[4];
file->read(&frame, sizeof(frame));
if (flags&1)
readFloats(positionData, 3);
if (flags&2)
readFloats(scaleData, 3);
if (flags&4)
readFloats(rotationData, 4);
#ifdef __BIG_ENDIAN__
frame = os::Byteswap::byteswap(frame);
#endif
core::vector3df position = core::vector3df(positionData[0], positionData[1], positionData[2]);
core::vector3df scale = core::vector3df(scaleData[0], scaleData[1], scaleData[2]);
core::quaternion rotation = core::quaternion(rotationData[1], rotationData[2], rotationData[3], rotationData[0]); // meant to be in this order
maybe this is the problem? i'm did that:
Code: Select all
f32 positionData[3]={0};
f32 scaleData[3]={0};
f32 rotationData[4]={0};
if i compile, it's 3,48 MB. if i use the old, it's 2,02...
hi i have a problem when trying to set rotation of bone because when i use
node->setJointMode(EJUOR_CONTROL);
and i start animating character then part of my mesh starts "flashing", like if it was changing visibility of part of my mesh every frame, but not whole mesh
the rotation of bone is set correctly so there is no problem, also if i use node->setJointMode(EJUOR_READ); everything acts correctly
node->setJointMode(EJUOR_CONTROL);
and i start animating character then part of my mesh starts "flashing", like if it was changing visibility of part of my mesh every frame, but not whole mesh
the rotation of bone is set correctly so there is no problem, also if i use node->setJointMode(EJUOR_READ); everything acts correctly
aha
can someone post the source again please.
hey
its solved, and integrated in new irrlicht ( the problem was that it rendered the childs double times.. so
and so on, so with many childs, it makes veery slow
but its ok now)
by the way what you wanna do like i did?
tecan: what source?
its solved, and integrated in new irrlicht ( the problem was that it rendered the childs double times.. so
Code: Select all
1
/\
2 2
/\/\
2 22 2
but its ok now)
by the way what you wanna do like i did?
tecan: what source?
I've read your post b4, the code here
And you said you want connect joint to joint instead of connect model to joint, how about like this
I didn't test the code since I don't have this kind of seperated models. I don't know whether it is possible to connect joint to joint.And you said in last post, the child was calculate twice, but i don't understand which function make it double calculate.
Code: Select all
jTorso = model->node->getJointNode("torso");
jHead = torso->getJointNode("head");
jrArm = torso->getJointNode("rarm");
jlArm = torso->getJointNode("larm");
jlHand = larm->getJointNode("lhand");
jrHand = rarm->getJointNode("rhand");
jTorso->addChild(torso);
jHead->addChild(head);
jlArm->addChild(larm);
jrArm->addChild(rarm);
jlHand->addChild(lhand);
jrHand->addChild(rhand);
Code: Select all
jTorsoOfParent = model->node->getJointNode("torso");
jHeadOfParent = torso->getJointNode("head");
jlArmOfParent = torso->getJointNode("rarm");
jrArmOfParent = torso->getJointNode("larm");
jlHandOfParent = larm->getJointNode("lhand");
jrHandOfParent = rarm->getJointNode("rhand");
// child joint
jTorsoOfChild = torso->getJointNode("torso");
jHeadOfChild = head->getJointNode("head");
jrArmOfChild = rarm->getJointNode("rarm");
jlArmOfChild = larm->getJointNode("larm");
jrHandOfChild = rhand->getJointNode("rhand");
jlHandOfChild = lhand->getJointNode("lhand");
// add child
jTorsoOfParent->addChild(jTorsoOfChild);
jHeadOfParent->addChild(jHeadOfChild);
jlArmOfParent->addChild(jlArmOfChild);
jrArmOfParent->addChild(jrArmOfChild);
jlHandOfParent->addChild(jlHandOfChild);
jrHandOfParent->addChild(jrHandOfChild);
Yesterday, i test a character with a sword attached on hand. i use mode-joint, and the sword attached correctly, I analysis the sword mesh in a model viewer, i found the sword has a joint at the handle of the sword. So it seems, when add child ,it will attach to the joint automatically? but if we attach a model with more joints, i don't know what will happen.
One more question, since your character seperate in several parts, how can you animated it. I mean, some animation related to all parts of the body, how you store your animation into the several parts, since irrlicht doesn't support skeleton store in a seperate file.
One more question, since your character seperate in several parts, how can you animated it. I mean, some animation related to all parts of the body, how you store your animation into the several parts, since irrlicht doesn't support skeleton store in a seperate file.
Yesterday, i test a character with a sword attached on hand. i use mode-joint, and the sword attached correctly, I analysis the sword mesh in a model viewer, i found the sword has a joint at the handle of the sword. So it seems, when add child ,it will attach to the joint automatically? but if we attach a model with more joints, i don't know what will happen.
One more question, since your character seperate in several parts, how can you animated it. I mean, some animation related to all parts of the body, how you store your animation into the several parts, since irrlicht doesn't support skeleton store in a seperate file.
One more question, since your character seperate in several parts, how can you animated it. I mean, some animation related to all parts of the body, how you store your animation into the several parts, since irrlicht doesn't support skeleton store in a seperate file.
well thats why you have to seperate model logically
so, seperate parts what has nothing to do with each other
eg: head, upper, lower, hands, legs
when running, head should do nothing (or move just a bit left right), upper: the hands moving, lower: moving legs, going body up down, legs: a bit movement, but doing nothing, hands: closing hands.
so, you dont have to see what the other parts doing.
for storing, you can store the animation for every model, or use useAnimationFrom.
so, seperate parts what has nothing to do with each other
eg: head, upper, lower, hands, legs
when running, head should do nothing (or move just a bit left right), upper: the hands moving, lower: moving legs, going body up down, legs: a bit movement, but doing nothing, hands: closing hands.
so, you dont have to see what the other parts doing.
for storing, you can store the animation for every model, or use useAnimationFrom.