PDA

View Full Version : Need a little help with this spin expression


TechnicallyArtistic
08-16-2009, 06:07 AM
Ok, somebody help me out with this. I'm sure I'm totally over thinking this, but I can't get this to work right.

I've got a sine wave I'm animating with an attribute. The attribute controls how fast the sin wave spins and which direction (positive forward, negative number backwards)

Here's the expression I'm currently using:
sine1.offset=((frame)*0.01)*tailControls.tailSpeed;

It works fine as long as I don't change the speed. I thought adding the tail control speed rather than multiplying it would add it every frame but it does not. But with the multiplier, if I change speeds if freaks out and flips all over the place, like it seems to be rewinding back to a specific number for spin, rather than continuing to add on. When I add tail speed, it just doesn't spin until the number changes.
I also tried adding on sin1.offset to it's self, but it doesn't seem to be doing it a frame. Maybe I've just spent too much time in particle land, but what am I don't wrong here?

TechnicallyArtistic
08-16-2009, 10:10 AM
Yeah, I was over thinking it, along with some decimal point typos, and other sin waves throwing me off (it's two together to spin like a cork screw. I kept trying to do the math separately on both of them and the offset between them kept multiplying exponentially so they were out of sync.)

Here's the expression I ended up using if it's helpful to anybody.

sine1.offset+= (tailControls.tailSpeed*0.01);
sine2.offset=(sine1.offset)+0.5;

If anybody comes across this trying to build a sperm tail, some added info is it's just two sine waves, one offset half a unit and rotated 90 degrees on it's side. They're deforming a spline, which can be hooked up to a Spline IK to control joints. In my case I have three splines. One set up with the sin deformers, one set up with clusters so I can manually deform it with controls. And then one more on the actual rig, with the Spline IK. I use a blend shape to blend in the sine wave curve and the manual control curve so I can do either or both to the rig.

CGTalk Moderation
08-16-2009, 10:10 AM
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.