[ODE] End point of a Ray&In-Reply-To=16901.1129119706@www55.gmx.net

Aras Pranckevicius nearaz at gmail.com
Wed Oct 12 17:28:37 MST 2005


> I tried it - it must be right. But dosn't work by me
> because I probably have problem with my input parameter - I have euler
> angles, so I just tried to divide it euler vector by "norm" to normalize
> this vector, but in euler its several, I guess.

Well, conversion from Euler angles to the direction vector is not
dividing by the "norm" of the angles (even if such thing as "norm of
the angles" would exist).

> do somebody know how to convert euler angles vector to ode-compatible
> unit vector? I guess, by this function
>   void dGeomRaySet (dGeomID ray, dVector3 start, dVector3 dir);
> is parameter dir a unit lenght vector, isn't it?

Yes.

> my input:
> rot - has euler notation of angles
>   float norm = sqrt(rot[0]*rot[0] + rot[1]*rot[1] + rot[2]*rot[2]);
>   rot[0] /= norm;
>   rot[1] /= norm;
>   rot[2] /= norm;

Your conversion is wrong. I suggest googling for something like "euler
angles to angle axis" (you'd take the 'axis' of the result; and
discard 'angle' because it does not matter for rays). And there are
usual problems with Euler angles, for example the result depends on
the order of rotations (xyz vs xzy vs yxz etc.)...


--
Aras 'NeARAZ' Pranckevicius
http://nesnausk.org/nearaz | http://nearaz.blogspot.com



More information about the ODE mailing list