v 2.0 - what's new   Gallery   Manual   Tutorial   Downloads   Links  
     

  AnimationLab v 2.0  

  Tutorial - Samples - Swirl

Getting Started

Scenario recording

Creatures Modeling

Samples

 

      

Swirl sample

Description

The sample demonstrates the ability to use functions as parameters of commands. All functions and variables are defined in Custom Script field, and are saved with the drawing.

Scenario

Actor: Light-1   
Commands=1
0 9  MoveAbs x y(x) z(x)

Actor: Light-2
Commands=1
0 9 MoveAbs x+3 y(x+3) z(x+3)

Actor: Light-3
Commands=1
0 9 MoveAbs x+6 y(x+6) z(x+6)

Custom Script
Dim x
Sub StepCustomAction
   x = StepNum*(3/10)
end sub

function y(x)
   y = sin(3*x)
end function

function z(x)
   z = cos(3*x)
end function

Notes: Y(x) and Z(x) functions define the equiation for movement along a spiral. Since the distance between the lights (along X axis) is 3 in, the second light has (x+3) coordinate, and the third one (x+3+3)=(x+6). We need light 1 to get to the place of light 2 in ten steps, so Custom Script has the line x = StepNum*(3/10) to accomodate this condition.

 

 

    
  Scroll To Start  AnimationLab Home Page    Contacts SoftDev SPb Home Page