Hello,
When I rotate my node on the left, it gets a negative number, like -1, then it goes -360, -475, -900, -5584,...
How to do like this : -1, -1, -1, I mean, I would like to have the real values between 0 and 360 when I do getRotation();
Thanks.
Stupid Question : Angles problem
Hello hybrid,
I'm using like this :
I'm using like this :
Code: Select all
vector3df objRot = obj->getRotation();
objRot.Y += 2.5f;
obj->setRotation(objRot);
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
This will wrap your angle in the 0-360 diapason. As far I understand this is what you want.
Put it before applying the rotation to the node:
Code: Select all
float angle;
if(angle>360) angle-=360;
if(angle<0) angle+=360;
Code: Select all
vector3df objRot = obj->getRotation();
objRot.Y += 2.5f;
if(objRot.Y>360) objRot.Y-=360;
if(objRot.Y<0) objRot.Y+=360;
obj->setRotation(objRot);
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."