Object Variables  (Animation Script)

Object variables refer to named objects from the scene
Global in scope


Operators
( . ) Invoke function


Declaration
Named and listed in Animation dialog

VERTEX Value
When used as VERTEX parameter Object center vertex


Object Functions

Parameter Modifiers
( - ) Use negative of center vertex value for function parameter

Notations

VERTEX - Declared VERTEX variable / object centter from named Object variable / surface normal from named Surface variable
float - Scalar floating point constant or VERTEX variable component (.x/.y/.z)


Functions Description and parameter type variations
Rotate Rotates Object around X, Y, Z axis

Rotate(float x, float y, float z)
Rotate(VERTEX V) 
   Rotate using Object's center 

Rotate(float x, float y, float z, VERTEX Center)
Rotate(VERTEX V, VERTEX Center) 
   Rotate using specified Center VERTEX 
 
*All rotations are specified in degrees 

RotateV

Rotates Object around specified Axis

RotateV(VERTEX V, float degree)  
   Rotate around VERTEX V axis using Objects center

RotateV(VERTEX V, float degree, VERTEX Center)  
   Rotate around axis in VERTEX V using Center VERTEX

*All rotations are specified in degrees 

Translate Translates Object along X, Y, Z axis

Translate(float x, float y, float z)
Translate(VERTEX V) 

TranslateV Translates Object along a specified axis, parameter t is distance to translate

Translate(VERTEX V, float t) 

SetCenter

Sets Object's center to specified location

SetCenter(float x, float y, float z)
SetCenter(VERTEX V)
  
GetWHD Gets Object Width, Height, Depth.  VERTEX parameter must be a local VERTEX variable

GetWHD(VERTEX V)
   V.x = Width
   V.y = Height
   V.z = Depth

ResetTransform Resets transform back to animation starting state

ResetTransform()




















































Examples


Named Objects in example, Cylinder, Rectangle
Named Surface in example, RectTop


VERTEX v

//Rotate Around Y Axis
Cylinder.Rotate(0, 1, 0)

//Rotate Around -Y Axis using named Object 'Rectangle' Center
Cylinder.Rotate(0, -1, 0, Rectangle)

//Rotate using named Surface 'RectTop' normal vector as rotation axis 2 degrees
Cylinder.RotateV(RectTop, 2)

//Subtract named Object 'Cylinder' center from named object 'Rectangle' center
v.Sub(Cylinder, Rectangle)

//Translate along negative vector direction of named Surface 'RectTop' normal using variable VERTEX component
Cylinder.TranslateV(-RectTop, v.x)