## Making body move with moving platform

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

### Making body move with moving platform

Hi all,

I am trying to make a body move with a moving platform.

Currently, I am using a kinematics user joint to move the platform around.
This seems to work nicely except I would like the ball to move with the platform too.

When the ball moves on to the platform, and the platform starts moving, the ball is rolling, but it seems to stay in the same position.
The ball will then fall off the platform.

Anyone know how to make the ball move along with the platform?
Maybe I need to change the friction values or something?

Here's a screenshot image:

Last edited by neimod on Thu Aug 28, 2008 2:15 am, edited 1 time in total.
neimod

Posts: 8
Joined: Wed Apr 23, 2008 9:34 pm

### Re: Making body move with moving platform

With teh new Newtonb it is very easyy to move ststic bodies and have the acting as if tehy were dynamics,
I beleive Matert Koom and Yeside show some demo of that.
Mastre K00m demo was almost what you looking for, maybe he can give some detail or pseudo code of hwo to go aboput.
Julio Jerez
Moderator

Posts: 11155
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

### Re: Making body move with moving platform

You need something like this ?

I use this code in this demo.
Normally your suposed to update newton before set the real pos.
This is already done from my system frame by frame when this command is use.
I have only get this method working good with a constant newton step update.
Or if you prefered a fix step time, and dtime.

Code: Select all
`procedure oxSetStaticBodyPositionV3(static: TOXNewtonStaBaseObject; pos: TOXVector3); var apos: TOXVector4;    bpos: TOXVector4;    tmat: TOXMatrix;begin  if static.Actived then begin    NewtonBodyGetMatrix(static.Body,@tmat[0]);    bpos:=tmat[3];    apos:=oxV4Make(pos);    bpos:=oxVAdd(tmat[3],oxVScale(apos,manager.BackDeltaTime));    NewtonBodySetVelocity(static.Body,@pos[0]);    TGLBaseSceneObject(static.UserData).Position.SetPoint(bpos);    static.UpdateTransformation;  end;end;`

Not sure if this pascal code can help if yes i'm happy.
Good luck.

Edited:
If you like to make roll the ball but with some breaking,
you can use the customjoint rollingfriction this do a excellente job, I have test.
You search a nice physics solution, if you can read this message you're at the good place
OrionX3D Projects & Demos: