Global rotation of joints
Global rotation of joints
Hi
i have a problem with rotation joints.
is it possible to rotate joint like in the modelling software when using global rotation.
i want to make my character's back point to a special direction (when shooting up, i want my character's back rotating up, etc)
thanks
i have a problem with rotation joints.
is it possible to rotate joint like in the modelling software when using global rotation.
i want to make my character's back point to a special direction (when shooting up, i want my character's back rotating up, etc)
thanks
Why do you need global for that?i have a problem with rotation joints.
is it possible to rotate joint like in the modelling software when using global rotation.
i want to make my character's back point to a special direction (when shooting up, i want my character's back rotating up, etc)
multum in parvo
ok let me explain u with pictures.
http://dotdotdot.site90.com/FTP/pic1.jpg
the first picture the shooting with pistol. as u see, i have to rotate it on the X axis, to make it point up or down
http://dotdotdot.site90.com/FTP/pic2.jpg
second picture is the revolver shooting. as u see, if i rotate on the X axis ( http://dotdotdot.site90.com/FTP/pic3.jpg picture 3) it seems bad.
http://dotdotdot.site90.com/FTP/pic4.jpg
4th picture shows what happens if i rotate on a global X axis. everything ok.
i want to achieve that rotation
http://dotdotdot.site90.com/FTP/pic1.jpg
the first picture the shooting with pistol. as u see, i have to rotate it on the X axis, to make it point up or down
http://dotdotdot.site90.com/FTP/pic2.jpg
second picture is the revolver shooting. as u see, if i rotate on the X axis ( http://dotdotdot.site90.com/FTP/pic3.jpg picture 3) it seems bad.
http://dotdotdot.site90.com/FTP/pic4.jpg
4th picture shows what happens if i rotate on a global X axis. everything ok.
i want to achieve that rotation
um... just check pic2 and pic3.
and check the arrow
the camera is from front. see where does the X axist point? if i rotate on that axis, the arm of my model wont point to center, but will move left or right (pic3)
ill make you a better picture
http://dotdotdot.site90.com/FTP/pic5.jpg
a little explainment: the first picture is the normal. check the red line, thats the line where the arm should move.
the second picture is the rotating on local space (how setRotation works).
see the arm? its moving to side. thats fugly
third picture is the rotating on global space (what i want to achieve), the arm is perfectly on the line, and looks good!
and check the arrow
the camera is from front. see where does the X axist point? if i rotate on that axis, the arm of my model wont point to center, but will move left or right (pic3)
ill make you a better picture
http://dotdotdot.site90.com/FTP/pic5.jpg
a little explainment: the first picture is the normal. check the red line, thats the line where the arm should move.
the second picture is the rotating on local space (how setRotation works).
see the arm? its moving to side. thats fugly
third picture is the rotating on global space (what i want to achieve), the arm is perfectly on the line, and looks good!
yeah and then if i rotate my character (for example when falling back), then my characters torso wont move..
....
ok lets start it from the beginning.
if u open a modeling software. u make a skeleton.
u select a joint. press rotation. then u can change either rotating locally (irrlicht setRotation function), or rotating globally.
that is what i want to achieve. the rotating on global axis.
can anyone help me with that?? (and not asking "why u need that" etc)
....
ok lets start it from the beginning.
if u open a modeling software. u make a skeleton.
u select a joint. press rotation. then u can change either rotating locally (irrlicht setRotation function), or rotating globally.
that is what i want to achieve. the rotating on global axis.
can anyone help me with that?? (and not asking "why u need that" etc)
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
The IBoneSceneNode* has a member function setSkinningSpace, and you can pass global to it. E.G.
Code: Select all
IBoneSceneNode* bone = node->getJointNode(0);
bone->setSkinningSpace(EBSS_GLOBAL);
hm i see no difference
i tried either
or setting the skinning space when loading. it was absolutely same as when i set it to EBSS_LOCAL
i tried either
Code: Select all
IBoneSceneNode* back = upperAnimNode->getJointNode("hip_up");
if (back)
{
vector3df currot = back->getRotation();
back->setSkinningSpace(EBSS_GLOBAL);
back->setRotation(vector3df(currot.X+vertical, currot.Y, currot.Z));
}