PDA

View Full Version : motorcycle on a path



sebrady
09-01-2017, 06:24 PM
I'm trying to get a motorcycle realistically follow a simple path and have its handle bars and front wheel turn. I can animate the handle bars and in MOTION UI tell it to on Heading follow path and they do. The problem is the body of the motorcycle does not look right. If I parent the body to the handlebars, the body turns with the handlebars, the body should have a delay before it starts to follow the path, but its really just tagging along doing whatever the front does. Cant figure out how to rig it.

https://www.dropbox.com/s/xutt6kghw8dtzl9/motorcycle.png?dl=0

shrox
09-01-2017, 06:44 PM
I just do it by hand, but I am sure someone would have a more automated solution.

Surrealist.
09-01-2017, 07:56 PM
Have you ever ridden one?

Either way I would study video on how they move.

Basically it is like this.

As the bike moves into the turn it leans. The front wheel turns slightly near the start of the turn.

Coming out of the turn it is in reverse.

I can't think of a good way to automate this.

Center of rotation needs to be at ground.

Following a path needs to leave bank rotation free.

A small rig of nulls might also help to separate rotations.

shrox
09-01-2017, 08:34 PM
Have you ever ridden one?

Either way I would study video on how they move.

Basically it is like this.

As the bike moves into the turn it leans. The front wheel turns slightly near the start of the turn.

Coming out of the turn it is in reverse.

I can't think of a good way to automate this.

Center of rotation needs to be at ground.

Following a path needs to leave bank rotation free.

A small rig of nulls might also help to separate rotations.

Yes, it's a complex series of variables to coordinate.

Surrealist.
09-02-2017, 02:08 AM
yep.

Another thing I noticed is on longer turns the wheel actually straightens back out a bit.

Anyway here is a file with some rigging and animation solutions for this kind of thing.

Not perfect but should get you going in the right direction.

Nothing fancy just Align to Path and parenting nulls to have more control over rotations.

MonroePoteet
09-02-2017, 08:56 AM
You could also use a Spline, drawing the path to be followed as a Curve in Modeler. Sample scene attached, using Surrealist's model (with a bit of streamlining :) ). This scene also uses an Expression to have the body of the bike follow the forks down the Spline.

The basic method is to draw the path in Modeler using Add Points (+) in order, CTRL-P to create an open curve, and move the points around to suit your needs. Save as Spline_Curve.lwo or something.

In Layout, bring in Spline_Curve.lwo and use Setup=>Curve To Spline to create a Spline. Using Scene Editor, select all the Nodes created by Curve To Spline, and in the Motion Options (m)=>Controllers and Limits tab, set them all to have Heading, Pitch and Bank as Spline Control.

AFTER setting the Bank to Spline Control, set it back to Key Frames, and use the Numeric input (n) to set all the Node's Bank to 0.0 degrees. The Bank for each node will be adjusted to cause the Bike to bank appropriately to the path.

Bring in Surrealist's Bike model, and set the Forks motion to Spline using the created Spline. Set the Front Wheel's parent to be the forks. Set the Bike's body (named Bike in the model) to also be Spline, and make the Back Wheel's parent the body.

Now, you can move the Forks down the Spline using it's Z position. As it passes each spline Node, adjust the Bank on that node to "look good" depending on how sharp the curve is at that point. Note that Curve to Spline creates Bones for its nodes, so select the created Spline, then press the Bones button to access the Nodes and adjust their bank.

To make the Body follow the Forks, I used an Expression. Press the "E" next to the Body's Z position, and select the Expressions tab at the bottom. Press "New" to create a new expression, which I called BikeBodyZ. Delete the word "Value" in the Value field, and enter:

-1+[bike:forks.Position.Z]

This is the LW expression syntax to subtract one meter from wherever the bike:forks Z position is. Then, press Apply to apply the expression to the bike:bike's Z position.

mTp