Page 1 of 1

Ball and platform

Posted: Sun Sep 06, 2009 10:18 am
by Rademanc
Hi there.

I want to do the following:

|-----------|
OO
OOOOO
OOO

I want a to have a rolling sphere as a wheel, with a platform that is attached to that wheel. The ball must be able to roll in any direction, but the platform must stay in the same place on top of the wheel. I have forces that
work on the corners of the platform to keep it level, but of course the sphere and plaform is connected with a ballsocket joint so it won't roll.
Any ideas?

Re: Ball and platform

Posted: Sun Sep 06, 2009 4:30 pm
by Norbo
Try connecting your wheel to the platform with three different distance constraints.

This could be done like so:

Code: Select all

DistanceConstraint c1 = new DistanceConstraint(platform, wheel, platformAnchor1, wheel.internalCenterOfMass, 0, .2f, 0);
DistanceConstraint c2 = new DistanceConstraint(platform, wheel, platformAnchor2, wheel.internalCenterOfMass, 0, .2f, 0);
DistanceConstraint c3 = new DistanceConstraint(platform, wheel, platformAnchor3, wheel.internalCenterOfMass, 0, .2f, 0);
where platformAnchor1, 2, and 3 are three different locations on the platform.

Since the distance constraints all connect to the same spot on the wheel, its angular motion will be unaffected. The three separate platform connections restrict unwanted relative linear motion.