On Wednesday 07 February 2007 07:13:28 Thomas Teufel wrote:

>
> Hi there!
>
> I want to steer a tire. ..
> Therefor I need to rotate the tire (along the y-axis) absolutely, not
> relatively as it is done with SetTransform() of the Movable of a
> MeshWrapper object.
>
> By using SetTransform(x), the rotation "x" is just added to the current
> rotation of the object.
> In this case if I steer right, so that the steering intensity is 1.0 the
> tire's y-axis rotation will be increased by 1.0 every frame.
>
> To get rid of this effect I tried the following:
>
> // in order to revoce the rotation: take the rotation, invert it and
> apply it on the object -> should result a rotation of zero
> csReversibleTransform rot_OLD = meshObj->GetMovable()->GetTransform();
> rot_OLD.RotateThis(csMatrix3(csYRotMatrix(-OLD_SteeringIntensity)));
> meshObj->GetMovable()->SetTransform(rot_OLD);
>
> // apply the new rotation on the object
> csReversibleTransform rot_NEW = meshObj->GetMovable()->GetTransform();
> rot_NEW.RotateThis(csMatrix3(csYRotMatrix(NEW_SteeringIntensity)));
> meshObj->GetMovable()->SetTransform(rot_NEW);
>
> But this somehow doesn't work well ..
>
>
> Does anyone know an other way for absolutly rotating an object?

Hi Thomas,
I think instead of using the RotateThis function to rotate your tire, it would 
be better to just directly set the transform?

meshObj->GetMovable()->SetTransform(csYRotMatrix3(NEW_SteeringIntensity));

Keeping in mind that csYRotMatrix3 takes a rotation in radians.
I might be missing something though. Hope it helps
Regards,
Chris.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to