[ODE] Rotating dRayClass?

Roland Kindermann iyo at gmx.de
Sat Sep 16 12:41:36 MST 2006


Hi,
dGeomSetQuaternion or dGeomSetRotation might do but I never tried them 
on a ray.
You probably have a rotation matrix for your camera. Assuming that you 
camera points along the z axis in its unrotated state you could do 
something like:
Vector v = cameraRotationMatrix * Vector(0, 0, 1);
dGeomRaySet(ray, rayPos.x, rayPos.y, rayPos.z, v.x, v.y, v.z);
Cheers,
Roland

Kyle Hubert schrieb:
> How can I rotate my dRayClass? In particular, I am using the Ray for
> selecting(picking) physics objects based on the user's viewport. I
> have it working nicely for when the "camera" is placed at a location
> with no rotation. Now, when I rotate the camera the point of
> intersection of the ray (the origin hasn't moved) should be rotated.
> Is their an easy way to do this? Like call dGeomRaySet then call
> dGeomSetRotation?
> 
> Thank you.
> 
> -Kyle
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 
> 



More information about the ODE mailing list