Nested Rotations for Snowboard Flip, Turn, Roll

Hi,

I can’t find out how to achieve the behaviour of Snowboard rotations.
I want to apply the rotation relative to each other which normally is the unwanted case, mostly treated like a bug.
I would like to first apply the flips and then, relative to the rotation calculated by the flips, apply the turn. Same with Rolls in Turnspace.

If I just set the velocity in each direction, the boarder would not flip anymore but turn around half way upt to the side and back down again.

this.rigidbody.angularVelocity = new Vector3(10,10,0);

Would be really great if anybody could help me with this unusual task.
Would like it best to have a physical conform solution.

Best Regards,
Pascal

It is very difficult to do things like this.

It is the heart of making today’s video games.

(You need only have a look at the poetic, breathtaking, jewel-like, beauty of the rig in that cliche of today’s charttoppers, MAMC.)

If life was easy, there would be no difficulties like this and you could always just do 2.5D games with Velocity and make plenty of money on the app store and go home to the kids.

The situation is discussed explained in this answer… Also note the video and so on that Fox posted.


(POINT A - SPIN HAS ONE ONLY AXIS) angularVelocity only exists on one axis. (Note - the identical applies to angular momentum or torque.)

Now, there are many common motions you “see in your head” which are, in fact, quite simply, NOT, an angularVelocity. For instance a zero-mass pencil which has a spin along the axis, and is tumbling cleanly in one plane. That notion simply, cannot, be expressed as an angular velocity. Rigidbody in PhysX have an angularVelocity and that’s it. In terms of doing it in Unity, one way or another you’d have to fake that with a wrapped object, or, just animate it with no physical meaning, just as Fox did in the original two lines of example code.

(POINT B - IT’S IMPOSSIBLE TO TUMBLE >>CLEANLY<< WHILE SPINNING) in the real world if you have a pencil with mass. If you try to make it spin, and, tumble in one plane, this is simply impossible due to gyroscopic effects. It’s just not possible - you always get wibble in to the third “overhead” axis. PhysX is true to this concept, i.e., it’s not possible in the real world nor in PhysX.

Importantly, note Bunny’s final comment below. In the skateboard Mareyograph video, the board IS IN FACT wibbling from overhead, if one could watch it carefully from that direction. (Unless there is a perhaps aerodynamic effect, if the Mareyograph was filmed in this universe, it has to be wibbling in the third dimension - note point B). It’s just that the wibble is small. As Bunny says, what you probably want in your rig is to set up the collider shapes so that the object is the type of object (just like a real skateboard - ie, “long thin” tensor) where the “wibble you must have” is minimised.


There are three ways you can proceed:

(1) devise an extremely sophisticated mathematics. To achieve “spin-tumble” it looks like you have to apply torque that is itself rotating in 2 dimensions over time (WTH!) to achieve such non-stable momentum “combinations”:. I truly struggle with this.

(2) you can do exactly what Bunny says, set up the object so it is more inclined to “not” go in to the wobble axis. similarly, you could essentially add aerodynamics, etc.

(3-A) you can make an “ingenious trick” rig like in my example project posted therein. hah!

(3-B) you can make a beautiful “hybrid” rig that pulls off what you want:

(3-B-*) there’s nothing at all wrong with “just animating” to achieve some “dimensions” (in the broad sense) of a rig. [footnote]

Hence …

3-B-i make yourself a snowboard rig that you MANUALLY (kinetically) can rotate along the long axis. ie you change the rotation every frame, like Walt Disney. have this system triggered by physical forces in the correct direction, or whatever

3-B-ii now make a game object that has a normal rigibdoy, yadda yadda, and does your spinning in the other dimension. Sit the thing from the previous point inside the thing from this point. Write some haiku code to make things align and play with the outside world - et voila.

Example, We recently had to do a !#@$@£ boomerang motion rig for a client. First I “tricked it up” using a rig with 4 layers, two physical and two just stupid kinematics (changing something every frame). This worked great and looked cool.

I felt dirty, like after one pleasure’s one’s self, so I went ahead and made a true boomerang physics simulator (with centripetal, precession, etc). This was plain annoying because I’m good at math conceptually but worthless in practice due to the alcohol. Anyway, that also worked fantastically.

The tragic result – they preferred the former! I actually prefer the former, to actually play, too! Good grief. The point here is you’re NOT necessarily a bad person, for moving from a pure simulation to a let’s say “hybrid” rig.

[footnote] it’s worth remembering: In every car racing game you’ve ever played … THE WHEELS DO NOT TURN. Someone hand me another bottle of 1990 while I digest that. the “wheels” turning is just a trivial, silly, comic thing where you move the wheel IMAGE based on a “last stage” calculation of how fast that “wheel” is moving over the ground. Good grief! it is totally and completely NOT simulated, not physical. It’s just an incredibly silly kinematic trick. So there is nothing “bad” if you do this same technique also to help you achieve some difficult rig.

I urge you to proceed with 3-B-i/ii above and see if you can get some results you like.