[ODE] Objects rotating the wrong way ?

Steve Baker sjbaker1 at airmail.net
Wed Oct 8 21:19:54 MST 2003


Rob Ruck wrote:
> Ive started to attach meshes, etc. to my physics objects, and I've noticed the 
> objects seem to rotate mostly the wrong way, at least when I seem to add 
> force to a ball rolling along a surface, it rolls with the bottom going to top, 
> rather than vice versa (not a good description, but imagine a cars wheels 
> rotating reverse direction when going forwards).

Could this be a case of 'temporal aliasing' in your graphics chain?

I'm not sure for certain - but I can tell you that on one occasion I searched
for a problem like this for a week only to find that my wheel was doing the
right thing - but that temproral aliasing was making it look wrong.

The canonical example is old cowboy movies where the wheels on the stage-coach
alway seem to be going backwards.

Suppose we are looking at a wheel with (say) 12 spokes spaced 30 degrees apart.
If the wheel rotates at 1 degree per graphics frame, you see all 12 spokes move
forwards at tiny bit and the rotation looks OK.  However, if the wheel turns
faster, odd things can happen.  If the wheel rotates at exactly 30 degrees per
frame, then because it's a perfectly symmetrical wheel and one spoke looks much
like another, it *looks* like the wheel didn't turn at all.  But if the wheel
rotates 29 degrees forward, it looks exactly like it would if it had rotated
one degree backwards...so instead of spinning rapidly forwards, it *looks* like
it's spinning slowly backwards.

This nasty problem will happen any time this particular wheel rotates at 15 degrees
per frame or faster.  In general, the limit is half of the rotational symmetry angle.

One way to help this is to paint one of the spokes a different colour.  Now, the
wheel has no rotational symmetry (or the rotational symmetry angle is 360 degrees).
In this case, the wheel will look OK so long as it spins no faster than 179.999
degrees per frame.

Another way is to add motion blur...render your wheel so that it's smeared out over
the duration of the frame...in this case, it may not help much since all it really
does is make the motion of the wheel into a continuous blur above the magic angle
at which motion would go wrong if you didn't blur the motion.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----



More information about the ODE mailing list