Global rotation of joints

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

yea, so i have to try switching the axes for every animation? thats around 10-20. no thanks :D

and i can do that with setRotation. i just dont know how to calculate how much should i rotate on witch axis.

i need something like that

Code: Select all

vector3df curRot = joint->getRotation();
curRot = calculateGlobal(curRot) + vector3df (90, 0, 0);
curRot = calculateLocal(curRot);
joint->setRotation(curRot);
ooorr

Code: Select all

joint->setRotation(joint->getRotation() + calculateLocal(vector3df(90, 0, 0));
calculateLocal should return the relative rotation from the parent joint.
like, if its rotated by 90 on Y axis, then it should return vector3df(0,0,90);
Image
Image
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

more than half of this topics post is my bumping... but i really need this, please answer me ><
Image
Image
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Seems like we have a similar problem:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=38040

However, I have no solution either :(

greetings
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

Image
Image
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hi B@z,

what about getRotation()? or getAbsoluteTransformation().getRotation()?

U can use this to get the Rotation of the parent.

MfG
Scarabol
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

hi thanks for your answer, but as i said before, i need to SET it not, get..
Image
Image
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

// Set the Absolute Position or Rotation of the Joint without fear!
vector3df newJointPos = jointPos + vector3df( 0, 1+(sin(headPosition)*2), 0 );
vector3df newJointRot = vector3df( 0, headRotation, 0 );

// Transform the Position by the Parent's Inverse matrix before applying it
iparentTransform.transformVect( newJointPos );

// APPLY
thisJoint->setPosition( newJointPos );
thisJoint->setRotation( newJointRot );
multum in parvo
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

// Set the Absolute Position or Rotation of the Joint without fear!
Sounds cool - doesn't work. The space of the rotation is not affected in any way and the transformation of the position is not helping either. It even looks weirder than before.

greetings
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

Adler1337 wrote:
// Set the Absolute Position or Rotation of the Joint without fear!
vector3df newJointPos = jointPos + vector3df( 0, 1+(sin(headPosition)*2), 0 );
vector3df newJointRot = vector3df( 0, headRotation, 0 );

// Transform the Position by the Parent's Inverse matrix before applying it
iparentTransform.transformVect( newJointPos );

// APPLY
thisJoint->setPosition( newJointPos );
thisJoint->setRotation( newJointRot );
as u see, it doesnt do anything with rotation. its "absolute position" and "(relative)rotation"
Image
Image
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Smoke matrixes.
Do you like VODKA???
Image
Image
Scarabol
Posts: 167
Joined: Sat Jan 03, 2009 5:26 pm
Location: Aachen, Germany

Post by Scarabol »

Hi,

are u sure your input is right? Did you check this?
It is not always a formula fault... my experience.

Btw do u know what transformVect do or how it change the case?

MfG
Scarabol
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

transformvect transformating the vector with rotationdegree. so simply rotates your vector

scarabol: saying that to who? :D

Bear: guess so, but dunno how to do.. so im asking here XD
Image
Image
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Maybe not 8)
Do you like VODKA???
Image
Image
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

i have to dump it again -.-
Image
Image
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

is it that hard? why can't anybody give me a sollution? ><
please help ><
Image
Image
Post Reply