PDA

View Full Version : proper Wheel Rig


Holzi
02-23-2012, 11:12 AM
Hi Guys,

i worked my self through this tutorial (http://paulneale.com/tutorials/custAttributes/customAttributes.htm) and this addition (http://blog.duber.cz/3ds-max/intermediate-wheel-rig).
In there, they basically tell you how you can set up the rotation of the wheel depending on the movement of the master control.
However, I struggle to set up the second part with the direction vector. The calculating snippet of the guy looks like this:

local posIncrement = 0.0 as float
posIncrement = length((master.pos - (at time (currentTime-1) master.pos)) * master.transform.row2)
rotation = (posIncrement+storedDistance)/(wheelRadius)


so how do I get the posIncrement Calculation into the parameter wiring?
I only got that far to take the normal X_Position and divide it by the radius from a spline circle (which I use as dummy to define the radius of the wheels. so the rig gets more reusable)

-X_Position/$master_wheel.radius


However, if I try to add the calculation to the wire parameter, I get the following error: "Incompatible types: 0.0, and undefined"

My obviously wrong code looks like that:

local posIncrement = 0.0 as float
posIncrement = length(($car_master_rig.pos - (at time (currentTime-1) $car_master_rig.pos)) * $car_master_rig.transform.row2)
(posIncrement+storedDistance)/($master_wheel.radius)



Any suggestions?

Holzi
02-23-2012, 12:01 PM
Alternatively, is there a way to acces the LOCAL x Axis?

PEN
02-23-2012, 05:16 PM
I would suggest using a script controller and not a paramWire.

Holzi
02-24-2012, 08:53 AM
I would suggest using a script controller and not a paramWire.
I get the same error message there as well :(

PEN
02-24-2012, 01:23 PM
I'm not really sure what you are asking. You say "how do I get it into a parameter wire" use a script controller, set up variables in the left hand panel, attach those variables to tracks of animation or nodes and then use them in your expression.

Post an example max file if you are still having troubles with a full explanation of how to use it, the error and what you expect.

CGTalk Moderation
02-24-2012, 01:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.