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

Postby neimod » Fri Aug 15, 2008 6:31 pm

Hi all,

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

I've read posts about this topic on this forum before, but I couldn't completely figure it out.

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:
[url]dead[/url]

Thanks in advance.
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

Postby Julio Jerez » Fri Aug 15, 2008 6:40 pm

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
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Making body move with moving platform

Postby Dave Gravel » Sat Aug 16, 2008 12:52 am

You need something like this ?
http://evadlevarg.googlepages.com/Basic_Elev3.zip

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. :wink:
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron