Archived

This topic is now archived and is closed to further replies.

Help with angles..

This topic is 4975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi guys.. I will post this here, coz the owner forum is to slowly in conversation... I am using NeoEngine but, i guess *everybody* will understand.
EulerAngles angleBuffer = EulerAngles(Vector3d 0.0f,45.0f,0.0f),EulerAngles::XYZr);
pkBox->SetRotation(Quaternion(angleBuffer), true);
.
.
.
Quaternion rotationBuffer = pkBox->GetRotation();
EulerAngles rotation = rotationBuffer.ToEulerAngles();

ok... assuming I have setup a 45 degrees( ??? ) in the beggining on the Y axis, why, after making NO rotations, the rotation.m_kAngle.y is TOTALLY different of 45 degrees ( ??? ). Here''s what I have inside my head. I have a cube dropped in the floor. Free fall. And this cube has a middle-high restitution value. So, he will bounce gracessely. But as he is bouncing around, he spins in your 3 local axis, right!? OK. Think only in the X axis. While he is spinning, the rotation value (in the degrees) on the X must blow like 360 per completely turn the box make. Right? So why, why why, why why I am far away of thoses values?! Can somebody please help?

Share on other sites
Just wondering... are you sure these angle values are in degrees? Have you tried using radians?
Another point... this function Euler angles, what are the parameters? (angle with x, angle with y, angle with z) or do we just have to set a vector coordenates?

Share on other sites
EulerAngles is not a function.. well it is.. but is a constructor...

and i am assuming that euler angles are in degrees, isn't?!

I am not an american. And I am self taught. But its very very hard to understand all those technicals explanations about Euler and Quaternions...

I just want to use something real easy.
"OK cube, now i want that you will rotate 45 degree on Y axis!"

Just this.. All these transformation are almost driving me mad.

[edited by - gelerorox on June 9, 2004 10:08:27 PM]

Share on other sites
Ok. use Radians! Damn! I just forgot everything about trigonometry classes years ago!

Share on other sites
Chill out, man.
What we have defined in trigonometry is that pi radians = 180 degrees. So, if you want to convert from degrees to radians, you have to multiply your angle in degrees by pi and divide it by 180. Let''s see how it works:

(Angle radians) = (Angle degrees) * pi /180

just to remember, pi = 3.14159265359, so pi/180 = 0.01745 nearly..

so, if you want to convert you 45 degrees to radians, you''ll have to:

(Angle radians) = (45 ) * pi/180 = (45) * 0.01745 = 0.78539

Hope that helps!
try typing 0.78539 instead of 45.

Share on other sites
OK... thanks man... help a lot.

Anyway, still there''s a some problems on NeoEngine stuff.
Just clearing the things:

The engine treat the angles like this:
0.25 * pi = 45 degrees
soom, 1 * pi = 180 degrees.

so, i got some tests with the "0.25f * PI" kind of thing.
and works fine but still the output data has some weird values...

I am still using the cube I used to dropped on the floor. But now he isnt a rigidbody anymore. So he is floating in the air. And I am catching the keyboard input to make some transformations.

Ok. Using the "a" and "s" keys I can increment and decremet the rotation on the Y axis. Well I am incrementing or decrementing the value that I used to multiply by PI.

Now the odd behavior. I cant complete a full 360 degree turn. I just cant. And I cant understand why.

I think, if the cube is rotating along the Y axis, can he rotate like forever...
the values can grow like:
0.35f * pi
0.45f * pi
.
.
25f * pi (which is 4500 degree or approx 12 and a half completely turns on the Y axis)

why, I cant get those values?

I mean, after 180 degrees the cube looks to flip vertically screwing my (i)logical thinking.