PDA

View Full Version : Expressions for a windmill



wacom
06-15-2005, 05:50 PM
I don't know why I can't get my head around this problem but here goes:

I have a mindmill, which I want to A: Turn in the direction of the dynamic wind object in my scene, and B: Spin as the wind blows.

Part A was really easy with expressions...

Part B, well I know what I need to do...but I dont' know how to do it with expressions yet...

Since one is in degrees I need to have the value of the wind velocity constantly added to the previouse value that the windmill turned. I've tried using something like:

[Null.particlefx.Position.Y] + [Null.particlefx.Position.Y,Time + 1]

but this still (as to be expected) returns a value that isn't additive to the last one for the windmill. So the windmill goes two steps forward...three back etc. I should point out that this isn't a constant wind- otherwise I'd just animate it by hand.

So how do I store the value of the Windmill's rotation, and add in the wind velocity for each frame to keep the windmill rotating in one direction without the expression editor giving me a loop error?

Surrealist.
06-15-2005, 08:42 PM
There is a Motion FX Modifier. Are you familiar with that one?

It has a setting for rotation based on wind.

Don't know if it will work or not but here it is: Motion Options/Add Modifier

wacom
06-15-2005, 10:47 PM
Didn't even think to look! Thanks- I'll check it out...might have been forced into Lscripting for a second there (not that it would have been a bad thing).

Thank You.

PS- If anyone knows how to do this with expressions- or if I'd have to script for it, I'd like to know...

Surrealist.
06-16-2005, 03:03 AM
Cool. I'd be curious. I tried the roation with motion but not with wind. One setting to keep in mind is on the mode tab make shure Mode is set to motion+rotation (what I used) or at least rotation but I'm not sure for your app - the manual wasn't clear on that one.

You'll experiment I guess. I'm Currious to see how it turns out.