[ODE] simulation loop problem
Roel van Dijk
roelvandijk at home.nl
Wed Sep 7 12:14:14 MST 2005
How are you observing the simulation? If you're rendering the objects in the
simulation don't forget to draw them after each world step.
On Wednesday 07 September 2005 09:09, Esra Suel wrote:
> I am trying to make a simple body walk. What I want to do is to apply a
> force for a certaion amount of time at a certain point. then, after that
> time, apply another force and it should go like that. But I cannot find how
> to apply certain forces and torques for certain amount of time.
>
> as a simple example,
> I tried this code in my simulation loop I was hoping my body to start
> rotating and then stop. but i did not see any rotation.
>
> Code:
>
> dBodyAddRelTorque(body[0],0,10,0);
> SpaceCollide (space,0,&nearCallback);
> dWorldStep (world,0.0002);
> dBodyAddRelTorque(body[0],0,-10,0);
> dSpaceCollide (space,0,&nearCallback);
> dWorldStep (world,0.0002);
>
>
>
>
> I though that maybe the time step is to small for me to observe the
> rotation, so I tried the code below. But there was no difference.
>
> Code:
> dBodyAddRelTorque(body[0],0,10,0);
> SpaceCollide (space,0,&nearCallback);
> if (a < 20000000)
> {
> dWorldStep (world,0.0002);
> a++;
> }
>
> dBodyAddRelTorque(body[0],0,-10,0);
> if (b < 20000)
> {
> dWorldStep (world,0.0002);
> b++;
> }
>
> So know I do not know what to do, I would be glad if you could help me out.
>
> Thanks
More information about the ODE
mailing list