Dynamic Component Animation

Explanations, Walk through, tips and techniques related to LightUp
Post Reply
User avatar
AdamB
Site Admin
Posts: 2294
Joined: Wed Apr 16, 2008 10:11 am
Location: Brighton, UK
Contact:

Dynamic Component Animation

Post by AdamB » Sun Aug 23, 2009 5:48 am

On starting Tourtool, LightUp examines Dynamic Components for OnClick ANIMATE behavior and honors it while in Tourtool mode.

Simple functions such as:

Code: Select all

ANIMATE("X", 0, 100, 300)
will cause the DC to move between X=0, X=100, X=300 and back to X=0 on each click of the mouse.

Code: Select all

ANIMATE("X", 0, 100, 300),flyback
will skip the move from X=300 to X=0 and jump right back.

Code: Select all

ANIMATE("X", 0, 100, 300),flyback,forever
will cause the animation to continue unaided and not require additional mouse clicks to move to the next position.

Code: Select all

ANIMATE("X", 0, 100, 200),flyback,forever,pause
will cause the animation to continue forever but pause briefly at each position.

Code: Select all

ANIMATE("X", 0, 100, 200),flyback,forever,pause,time=3.2
will cause the animation to take 3.2 seconds to complete

Code: Select all

ANIMATE("X", 0, 100, 200),flyback,forever,pause,time=3.2,delay=0.5
will cause the animation to wait for 0.5 seconds before starting

When an animation is activated by a mouse click, all DCs with the same name will be activated allowing complex animations to be started at the same time (and possibly staggered using the 'delay=' option)

LU supports "X", "RotX", "Y", "RotY", "Z", "RotZ" in the normal manner and additionally supports moving/rotating with respect to the local axes of the Component rather than the Model XYZ axes. This is accomplished by using lowercase letters for the axis name.

Code: Select all

ANIMATE("roty", 0, 720),forever
will rotate around the Components Y axis regardless of where you place/orient it.

SU allows more complex movements to be build by adding more and more ANIMATE() functions. EG one for X position, another for Y., which can become cumbersome and is not supported by LU.

Instead, LU adds a new mode to ANIMATE called 'transformation':

Code: Select all

ANIMATE("transformation", "name_of_a_path_group")
The "name_of_a_path_group" is a SU group/Component that consists of just a single set of connected lines/curves forming a path to follow. On activation of an object with this style of ANIMATE() function, the object will follow the 3D path from start to finish.

You can additionally add an extra parameter whether to orient your object along the direction of travel or not.

So:

Code: Select all

animate("transformation", "a_path"),time=10.0,orient,flyback,forever
would animate your object along a path called "a_path" taking 10 seconds to complete and orienting the object along the direction of travel. At the end of the path the object will "flyback" instantly to the beginning. The animation, once started, will continue forever.

Because LU supports a number of extensions to the regular SU dynamic Component ANIMATE function, they only work in Tourtool mode. SU will just not understand this extra functionality. If you wish to keep the LU ANIMATE behavior completely separate from the SU ANIMATE behavior, you can use "onclick_lightup" as the behavior name in the DC rather than the standard "onclick".

Adam
Developer of LightUp http://www.light-up.co.uk

daniel8742
Posts: 74
Joined: Thu Jul 24, 2008 1:31 am

Re: Dynamic Component Animation

Post by daniel8742 » Thu Nov 04, 2010 12:18 am

Hi
Can i read a postion(X,Y,Z) of component and use like:
"ANIMATE (X, X+100,X+200,X+300)" to act for my component ?

Daniel

User avatar
AdamB
Site Admin
Posts: 2294
Joined: Wed Apr 16, 2008 10:11 am
Location: Brighton, UK
Contact:

Re: Dynamic Component Animation

Post by AdamB » Mon Nov 08, 2010 9:19 am

daniel8742 wrote:Hi
Can i read a postion(X,Y,Z) of component and use like:
"ANIMATE (X, X+100,X+200,X+300)" to act for my component ?

Daniel
No, LightUp doesn't currently implement a general expression evaluator. Just a simple expression to allow adding some animated components to your Tourtool session.
Developer of LightUp http://www.light-up.co.uk

Post Reply