Forum: Poser Python Scripting


Subject: Steering a vehicle

ockham opened this issue on Dec 18, 2001 ยท 6 posts


ockham posted Tue, 18 December 2001 at 11:22 AM

Here's a script to make a vehicle (car, lawnmower, wheelchair) steer properly. You first set up the animation frames, and then translate the vehicle to where you want it at each frame. (Usually you can set just a few frames and let the spline take care of curving it between those.) Once that's done, apply this script, and the vehicle will end up rotating on the Y axis appropriately so that it appears to be steering into each turn. See notes in the script itself for more specific instructions and limits. I'll be adding a couple more features (like banking) shortly. The script is inserted here; its original name is STEER.PY.

My python page
My ShareCG freebies


ockham posted Wed, 19 December 2001 at 9:06 PM

Here's an improved version, which can bank or lean the vehicle as it turns. Extensive notes inside the .PY file.

My python page
My ShareCG freebies


DraX posted Sat, 12 January 2002 at 4:51 AM

Will this work for a Figure as well as a Prop? After looking at the script, it appears as though it's for Props only, though I could be wrong...


ockham posted Tue, 15 January 2002 at 6:35 PM

Well, I meant it to be used with a Prop, as in some sort of four-wheeled vehicle. But after some experimentation, I found that if you replace "Vehicle" with "Body" through the script, it works well on the currently selected Figure. I don't know what use this would be, except that it sort of looks like ice skating! The banking constant (in the function call at bottom of script) would need to be negative for that purpose, so that the figure would lean into the turns instead of outward as a car does. (Riding a bicycle would also need a negative bank value.)

My python page
My ShareCG freebies


DraX posted Tue, 05 March 2002 at 2:33 AM

..Actually, my original thoughts on this would be to have a superman-like figure flying, which would require some banking. Any chances of getting this script to apply "steering" and banking based on the Actor's position on the Y axis, as well? so that if it's moved up it will move along the X and Z axis in relation to the direction it's going in? I.E. the Actor turns up or turns down as it moves up or down?


ockham posted Tue, 05 March 2002 at 10:31 AM

Ah! It took me a minute to see what you're talking about. Like an airplane: nose upward when trying to increase altitude, nose down to dive. Will be easy to include that. I'll post that revision later today.

My python page
My ShareCG freebies