[ODE] fixed path constraint

jnilson_99 at yahoo.com jnilson_99 at yahoo.com
Tue Jul 5 22:21:10 MST 2005


"did anyone implement a fixed path constraint? "

i've fooled around with that a little. the most
elegant thing i can think of is 

-create a plane which contains the arc you want to
move in. you only need a plane bacause the constraints
on the body should move the body in an arc. think of a
shoulder, if i only move my upper arm on a plane my
hand can only make an arc.

-each time step find the vector from your body to that
plane (see method proj_point_on_plane below)

-adjust the force on the body along that vector to
bring the body back into alignment. if you're using
amotors, find the angles that vector makes with the
joints axis and torque the joint to bring the body
into alignment with the plane.

Vec3 proj_point_on_plane(Vec3 point, Vec3 plane,Vec3
normal)
{
Vec3 qp;
qp = vec3_diff(plane, point);
return (vec3_sum(point, vec3_times(vec3_dot(qp,
normal), normal)));
}

john

--- Cristian Bianchi <cris at cris.hspace.name> wrote:

> Hi to all
> did anyone implement a fixed path constraint? I'd
> like to constraint the
> movement of a body along a curve. I know I can use
> the classic spring/damper
> approach... but I think ODE joint would be more
> precise and reliable. :)
> Any suggestion/code trick?
> Thanks in advance
> 
> Cristian Bianchi
> Simulation Software Division
> DIESGroup srl, Rome - Italy
> 
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 



More information about the ODE mailing list