PDA

View Full Version : Expression controler if staement syntax


LoneRobot
09-01-2006, 01:08 PM
im trying to get the expression controller to check for two rotational variables but cant figure out how to phrase it.

Im reading the rotation of an object via a scalar called "Zrot" which is assigned to an x rotation controller in my scene.

i want it to operate by doing no rotation when the rotation is between the values -0.1 and +1.0. after that, i want it to start rotating exactly 50% of the rotation of the assigned object.

my problem is that in MXS i could do multiple if/then/else statements. in the expression controller it is slightly different. the two statements that work are as follows -

if (Zrot>-0.1,0,(Zrot+0.1)*0.5) for the down rotation, stationary until -0.1 and then at 50% after, and :

if (Zrot<0.1,0,(Zrot-0.1)*0.5) for the up rotation, stationary until +0.1 and then at 50% after.

is there a way to combine the two statements in the expression controller?

LoneRobot
09-01-2006, 06:25 PM
well its not exactly obvious but -

if (Zrot>-0.1,if (Zrot>0.1,(Zrot-0.1)*0.5,0),(Zrot+0.1)*0.5)

CGTalk Moderation
09-01-2006, 06:25 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.