hi @all
i'v a problem with the rotation in degrees
if have an up and an dir vector
up is not everytime 0,1,0
dir is the direction
now i rotate dir around up (that works)
but how do i get now the rotation of the object in degrees ?, so that the object rotates to even this dir ???
thx
Rotation Matrix ??
use: matrix4::getRotationDegrees()
you may aply this fixes before using it:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2234
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2458
BTW: howe do you rotate around up vector?
you may aply this fixes before using it:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2234
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2458
BTW: howe do you rotate around up vector?
i'll try the fixes
i rotat around th up with :
that works but how do i now rotate the (for example car) on the screen to reflect these rotations ( up ist die up vector from the street and dir the moving direction) it moves, but the car shows to everywhere , but not to dir ![Wink ;)](./images/smilies/icon_wink.gif)
i rotat around th up with :
Code: Select all
dir=
(dir+
dir.crossProduct(up.normalize()) *sin(2*PI*rotate/360)).normalize().crossProduct(up.normalize())
.crossProduct(up.normalize()).normalize()*-1;
![Wink ;)](./images/smilies/icon_wink.gif)
think i did it
Code: Select all
matrix4 h;
h.buildCameraLookAtMatrixRH(car->pos,car->pos+car->dir,car->up);
h.makeInverse();
car->rotation_angle=h.getRotationDegrees();
car_object->setRotation(car->rotation_angle);
![Smile :)](./images/smilies/icon_smile.gif)