// Hi Ross,
//
// you could write a macro like this:
#macro CalculateFrameParameters (TheClock)
#declare Flap = sin(radians(TheClock*360*FlapsInAnimation));
#declare Spread = /* whatever*/;
/* ... */
#end//macro
// Then do this at the beginning of each frame:
#declare ShortTime = 0.01; // or clock_delta
CalculateFrameParameters (clock-ShortTime)
#declare OldFlap = Flap;
#declare OldSpread = Spread;
CalculateFrameParameters (clock)
// Now a comparison of OldFlap and Flap
// tells direction and intensity of
// the motion. For example:
#declare WingSpeed = (Flap-OldFlap)/ShortTime;
#if (WingSpeed>0)
/* wing goes up */
#else
/* wing goes down */
#end
// If your formulas don't like TheClock<0
// then add the following statement between
// "#macro ..." and "#declare Flap ...":
#if (TheClock<0) #declare TheClock = 0; #end
// Sputnik
Post a reply to this message
|