traj

Principle

All properties of all anyflo objects can be animated by trajectories that contain lists of variations of these properties over time, this is cinematic animation. Another method of animation, called dynamic, is to define these properties over time using differential equations of the dynamic, but even in this case, we can define the trajectories of some type kinematic parameters of the dynamic (masses, forces, torques, springs, etc..).

There are 2 ways to define trajectories assigned to an object:

Encapsuled trajectory

General syntax for creating

Object transformations:
`traj(ni)transf(p)obj(id);`
ni: is the number of images.
transf: is a
transformation
p: is a parameters list of the transformation.
obj(id): is the object of type obj and identifier id.
Options

Object properties transformation:
`traj(ni)propr(p)obj(id);`
propr: is a objet id property.
Notes:
the property propr must have been initialized for the object obj (id).
if ni=ni1,ni2 ni = rand2(ni1,ni2).

Examples

`traj(6)tran(0,0,0, 200,100,0)vol(1);`
`edit(traj tran vol(1));`
prints:
0.0 0.0 0.0
40.0 20.0 0.0
80.0 40.0 0.0
120.0 60.0 0.0
160.0 80.0 0.0
200.0 100.0 0.0

`traj(6)radius(6,8, 12,14)brush(1);`
`edit(traj radius brush(1));`
prints:
0.0 6.0 8.0
0.2 7.2 9.2
0.4 8.4 10.4
0.6 9.6 8.0
0.8 10.8 12.0
1.0 12.0 14.0
The 1st column is the number of the image (normalized between 0.0 and 1.0).
The 2nd and the 3nd are the rays.

`col vertex(2)vol(1)=1,.4,.2;`
`col vertex(2)vol(1);`
prints:
1.0 0.4 0.2

```traj(6)tran(0,0,0,100,200,300)vertex(1)vol(1)abs(2)period(-1); edit traj vertex vol(1);```
prints:
tran vertex(1)ni=6 cpt=0 period=-1
tran(1,6)
var tran(1,18)
`edit traj vertex vol(1);`
prints:
tran vertex(1)ni=6 cpt=0 period=-1
tran(0,0,0,100,200,300)
var tran(0,0,0, 20,40,60, 40,80,120, 60,120,180, 80,160,240, 100,200,300);

``` L1=-200,-200,-200, 200,0,200;L2=-1000,-1000,-1000, 1000,500,200; traj(6)limit(L1,L2)tran vol(1)abs; edit(2)traj limit tran vol(1);```
prints:
-200,-200,-200,200,0,200
-360,-2160,-360,"60,100,200
-520,-4120,-520,520,200,200
-680,-6080,-680,680,300,200
-840,-8040,-840,840,400,200
-1000,-1000,-1000,1000,500,200

General syntax for consultation

Object transformation:
`traj transf obj(id);`
Returns the trajectory of type transf (or of property propr) of the object id.
Special cases:
`1) traj rota vol(id);` returns a 3D line of the form:
xi,ai,0 with xi in [0,1] and ai = angle (in degrees).
To print this trajectory in radians, just do:
`edit((1,PI/180,1)*(traj rota vol(id)));`.
`2) traj quat vol(id);` returns a 4D line (quaternions) of the form:
wi,xi,yi,zi.
To print it, just do:
`edit(traj quat vol(id))format(4);`
Objetc property transformation:
`traj propr obj(id);`
Returns the trajectory of the propr) property of the objet id.

Object trajectory

traj(id)T

Defines trajectory id type T.
Example: traj func.

traj obj(id1)=id2

Attaches the trajectory id12 to the object obj(id1).
As anyflo general objet trajectories may be animated.

traj(id)animate(ni)type1(p1) type2(p2) ... opt1(o1) opt2(o2) ...

Sets the object identifier id and type traj with duration ni at order 1.

traj(id)animate(ni,n)type1(p1) type2(p2) ... opt1(o1) opt2(o2) ...

Sets the object identifier id, type traj with duration ni at order n: such a trajectory will be incremented each time a trajectory order n-1 is completed.

traj animate vol(id1)

returne the identifier of the trajectoty associeted to volume id1.

traj animate vol(id1)=id2

changes this identifier.
Note: trajectory id2 must be:
`traj(id2)animate(ni,n)P(p1,p2,...)...;`

Increment

Whenever the trajectories order n are finished the trajectories order n+1 are incremented.

options allow to specify the properties.
Such objects play the same role as the property traj defined above, but without being tied to a particular object. The command:
`traj obj(id1)=id2`
attach the trajectory id2 to the object obj id1 which may be of any type including a trajectory, which allows to define animations arbitrary order.

Example:
See in file demo1_traj.func the function:
GEN_TRAJ_TRAJ()
{
#include "externes()"
ni=Ni[2];interaction screen(ni);
/* Property trajectories order 0 */
an=PI*rand2f(-1,1);r=.5*(1+cos(an));v=.5*(1+sin(an));b=.5*(r+v);
EXEC="traj(ni)col(r,g,b, g,b,r, b,r,g)vol(1)abs(2)period(1)law(Loi);\n";
EXEC,="traj(ni+1)rotz(-an,an)vol(1)abs(2)period(1)law(Loi);\n";
/* Object trajectory order 1 */
EXEC,="traj animate vol(1)=1;\n";
p=gen_p();
EXEC,="traj(1)animate(ni,1)tran(p)abs(2)period(1)ext(5,1);\n";
/* Object trajectory order 2 */
EXEC,="traj animate traj(1)=2;\n";
p=gen_p();
EXEC,="traj(2)animate(ni,2)tran(p)abs(2)ext(5,1)period(-1);\n";
EXEC=compile message(EXEC);
}

traj (id)dim

Returns the images number of the trajectory id.

traj (id)NP

Returns the number of the current image of ethe trajectory id.

var traj(id)

Returns the 3D list (x1,y1,z1, x2,y2,z2, ..., xni, yni, zni) of the trajectory id values according of the type:
rota, rotx, roty, rotz, hom: xi dans [0.0,1.0], yi=value at image i, zi=0.
others: list of vectors at images 1, 2, ...,ni.

var propr traj(id)

Returns the 3D list (x1,y1,z1, x2,y2,z2, ..., xni, yni, zni) of property propr of the trajectory id, propr is:
col or transp for a trajectory type name associated to an image.
Options:
propr(0): first reference of (default).
propr(1): second reference of propr.

traj(id)animate(ni)type1(p1) type2(p2) ... opt1(o1) opt2(o2) ...

Defines an object type traj identifier id1 of duration ni and multiple type typei parameters pi.

traj obj(id2)=id1

Assignes trajectory id1 to objetc
obj identifier id2.
typei can be a geometric transformation and/or a property.
opti(pi) is an option of parameter pi.
obj is an anyflo object.
A transformation may have secondaries types, for example
rota(r) force(c).
These trajectories id1 are some object properties allowing to modify over time the matrices of objects id2 (by assigning the linear transformations parameters: displacement, dilatation, rotation) and thus to animate these objects:
traj(id1)animate((ni)T(p)
ni is the duration.
T is a linear transformation (tran,dila,dilx,dily,dilz,rota,rotx,roty,rotz,axis) or quat, p is the list of the parameters vectors of this transformation.

Examples:
```traj(1)animate(100)tran(-200,0,0, 200,0,0); traj(2)animate(50)rota(-PI,PI)vol(1)period(-1); traj vol(1)=1,2;```
The volume 1 will move over the segment (-200,0,0, 200,0,0) during 100 images and rotate between -PI and PI during 50 images.
Trajectories can be defined on some vertices or any other property of an object.

Options allow defining a cinematic (not linear movement), making periodic trajectory, to interrupt, etc..

Trajectory type

traj typei obj(id)
Returns the vectors list of the trajectory of type typei of the object id.
traj typei dim obj(id)
Returns the duration of the trajectory of type typei of the object id.

Object property trajectory

These are some object properties allowing to modify over the time some object properties and thus animate them.

traj(ni)P(p)obj(id)

ni is the duration.
P is a property, p is a vectors list of this property parameters.
id = identifier of the object obj.

Some trajectories are multityped such as traj force rota, in this case the parameters used to built them are accessible by:
`force traj force rota vol(id);` for the force coefficients.
`rota traj force rota vol(id);` for the rotation angles.

traj(ni)col(r1,g1,b1, r2,g2,b2, ...)vol(id)

Option:
matrix(n): number of components for a vector (default 1).
Example:
`traj(ni)transp(t1,t2,t3,t4)col(r11,g11,b11,r12,g12,b12, r21,g21,b21,r2,g22,b22, ...)vol(id)matrix(2)`
allows to vary (r1,g1,b1,r2,g2,b2).

traj(ni)col(r11,g11,b11, r12,g12,b12, ...)col(r21,g21,b21, r22,g22,b22, ...)vertex(v)brush(id)

allows to vary (r1,g1,b1, r2,g2,b2) colors at center and at edge of vertex v of brush id.

traj(ni)fog(r,g,b)zbuf(z11,z12, z21,z22, ...)

Builds fog trajectory with fog(r,g,b)zbuf(z1,z2).

traj(ni)force(f1,v1, f2,v2, ...)axis(x1,y1,z1, x2,y2,z2,...)vol(id)

Defines a torque.

traj(ni)force(f1,v1,0, f2,v2,0, ...)rota(a1,a2,...)vol(id)

Angles ai are achieved with a force rota amplitude f (f=.1, v=-.01 are good values) and viscosity v.
Note:
the volume id must have a mass.
yes dynamic must be active.

traj(id)animate(ni)func("f1 f2 ... fn")

the functions fi are executed in sequence every ni/n frame.

traj(ni)func(id1)obj(id2)

func id1 is executed every frame for object type obj and identifier id2.
Notes:
if id1=number, this number is passed to the C function TRAJ_FUNC_C(struct Objet *p_obj_traj, long num) of file utilb.c.
If id1="fff" the anyflo fff(ni,cpt) function is executed.

traj(ni)tran(x1,y1,z1, x2,y2,z2,...)aim view(id)

Same syntaxe for other transformations.

traj(ni)tran(x1,y1,z1, x2,y2,z2,...)eye view(id)

Same syntaxe for other transformations.

traj(ni)interpol(id1,id2,...)vol(id0)

Builds a trajectory of duration ni by interpolating points of volume id0 between those of volumes id1, id2, ...
Note:volumes idi must have the same topology.

traj(ni)interpol(id1,id2)image(id0)

Builds a trajectory of duration ni by interpolating image id0 between images id1 and id2.
Note: images idi must have the same topology.

traj(ni)name("NNN.eee")number(n1,n2)vol(id)

Reads images "NNNnnnn.eee" from nnnn=n1 to nnnn=n2.
Options:
col(r,g,b): image(id,id)transp(t)col(r,g,b)
col(r1,g1,b1)col(r2,g2,b2): image(id,id)transp(t)col(r1,g1,b1)col(r2,g2,b2)
col(r11,g11,b11, r12,g12,b12, ...)col(r21,g21,b21, r22,g22,b22, ...): allows vary the color coefficients
dim(nx,ny): size of images
number("nD",n1,n2): number on n digits.
transp(t1,t2): image(id,id)transp(t1,t2)col(r,g,b)
transp(t1,t2)transp(t3,t4): image(id,id)transp(t1,t2)transp(t3,t4)col(r,g,b)
transp(t11,t12,0, t21,t22,0, ...)transp(t13,t14,0, t23,t24,0, ...): allows vary the transparency coefficients

Quaternion trajectories

traj(ni)quat(q1,q2,...)vol(id)
qi is a quaternion of the form:
q = w,x,y,z, with:
w = cos(a/2)
a2 + x2 +y2 + z2 = 1
module(x,y,z) = sin(a/2)
Corresponding to the spatial rotation angle a and axis (x,y,z).

traj(ni)quat rota(r1,r2,...)vol(id)

The ri are of the form:
r = a,xr,yr,zr
Corresponding to the spatial rotation of axis (xr,yr,zr) and angle a.
These values are converted to quaternions which will be spherically interpolated.

traj(ni)rotz(a1,a2,...)vol(id)

traj(ni)transp(t1,t2,...)obj(id) Defines a trajectory on the transparency of an object id (image or volume).
traj transp col
traj transp luminance
traj transp texture
traj transp transp
traj transp vertex

traj(ni)transp(t1,t2,...)col(c1,c2, ...)image(id)
With ci=ri,gi,bi
Defines a trajectory over transparency of the image id by assigning transparency ti to pixels whose color is ci and transparency 0 to others pixels.

traj(ni)transp(t_11,t_12,...)transp(t_21,t_22,...)col(c_11,c_12, ...)col(c_21,c_22, ...)image(id)
With c_1j=r_1j,g_1j,b_1j and c_2j=r_2j,g_2j,b_2j
Defines a trajectory over transparency of the image id by assigning transparency t_1i to pixels whose color is in the interval c_1i,c_2i and transparency t_i2 to others pixels.

traj(ni)transp(t1,t2,...)luminance(lum1,lum2,...)image(id)
Defines a trajectory over transparency of the image id by assigning transparency ti to pixels whose luminance is lumi and transparency 0 to others pixels.

traj(ni)transp(t_11,t_12,...)transp(t_21,t_22,...)luminance(lum_11,lum_12,...)luminance(lum_21,lum_22,...)image(id)
Defines a trajectory over transparency of the image id by assigning transparency t_1i to pixels whose luminance is in the interval [lum_1i,lum_2i] and transparency t_2i to others pixels.
See examples in file demo1_traj.func, functions gen_TRAJ_IMA_TRANSP_COL() and TRAJ_IMA_TRANSP_LUMINANCE().

traj(ni)transp(t1,t1, ...)texture(num)vol(id)

If volume id has a multi texture (t1,t2,...,tn), this command defines a transparency trajectory on the texture num (1 <= num <= n).

traj(ni)transp(t11,t12, ...)col(t21, t22, ...)vertex(v)brush(id)

Allows varying (t1,t2) transparency at center and at edge of vertex v of brush id.

traj(ni)transp(t1,t2, ...)vertex(v)vol(id)

Allows varying (t1,t2,...) transparency of vertex v of volume id.

traj validate

Allows varying the validation of an object.
Example:
`reaj(25)validate(1,0)vol(id)abs period(1);`
the volume id will be visible 1 second and invisible 1 second periodically.

Options

abs

By default, a trajectory can be initialized only if a similar trajectory does not exist, or if it is completed, it begins at the current value of the animated parameter lively, abs option allows to specify how:
abs or abs(1): trajectory is initialized, even if it is not complete, and it starts with the current value of the parameter.
abs(2): the trajectory is set, even if it is not completed, and it starts the first value of the path parameter.

ini

The transformation is made from the starting position.

Law of motion

Default trajectory is linearly graduated, but we can give a law of motion (kinematics) by one of the options:
acc : accelerated.
dec: decelerated.
pend: pendulum.
law(x,y,z,...): according to the law law(x,y,z,...).
law(NIL) : no law (default).
ext(n,c,f): the 3D curve (ni parameters vectors) is built by extension (n,c,f) of (p) values.

Extension

traj(ni)T(p)obj(id)ext(n,c,f)
The 3D line (ni parameters vectors) is built by extension (n,c,f) of (p) values.

period

traj(ni)T(v)obj(id)period(p)
The trajectory is a periodic one, of period p.
If p=0 no period.
If p=1 (default): 1, 2, ..., ni, 1, 2, ..., ni, ...
More generaly, if per=1 and inc > 1: 1, 1+inc, ..., ni, 1, 1+inc, ..., ni, ...
If p=-1: 1, 2, ..., ni, ni-1, ni-2, ..., 1, 2, ...
More generally if per=-1 and inc > 0: 1, 1+inc, ..., ni, ni-inc, ..., 1, 1+inc, ...
Options:
period(p,inc): increment (1 default).

time

traj(ni)T(v)obj(id)period(p)time(t)
The trajectory is a periodic one achieving after t periods.

Object vertices trajectories

These are object vertices properties allowing to modifiate over the time some of their parameters and thus animate them:

traj(ni)P(p)vertex(s)obj(id)

ni is the duration.
P is a vertex property, p is the parameters vectors list of this property.
s is the number of the vertex.
id = is the identifier of the object obj.
The options are available.
The option ini transforms the vertex from its starting position. For several trajectories on the same vertex only the fist must have this option.

Examples of vertices properties:
col(r1,g1,b1,r2,g2,b2,...): colors.
force(x1,y1,z1,x2,y2,z2,...): forces.
rotx(a1,a2,...): x rotation.
roty(a1,a2,...): y rotation.
rotz(a1,a2,...): z rotation.
tran(x1,y1,z1,x2,y2,z2,...): displacement.

Trajectory of trajectory

We can define trajectories along trajectories (as with any anyflo object) to obtain an animation of order n (each image in the order n is the trace of the animation in the order n-1).
Note:
If several trajectories id2,id3,... are defined on the same trajectory id1, the first is executed with option ini (the source is the trajectory id1 origin), and the next without this option (the source is the trajectory id1 transformed by id2).
Must be defined:
1) volumes with objects trajectories of type animate order 1:
`traj animate vol(id)=t1,t2,...`
2) those objects trajectories order 1:
`traj(ti)animate(n1,1)tansf(p)`
3) assigned with objects trajectories of type animate order 2:
`traj animate traj(ti)=ti,1,ti,2,...`
4) those objects trajectories order 2:
`traj(ti,j)animate(n2,2)transf(p)`
etc..
Volumes id will be animated during n1 images on their trajectories ti.
Trajectories ti will be animated during n2 images on their trajectories ti,j and will be incremented every n1 images.
etc..
interaction screen(n1) specifies to clear the screen every n1 frames.

See an example in file demo1_animate.func.

Light trajectories

traj ambiance light

traj(ni)ambiance(r1,g1,b1, r2,g2,b2, ...)light(id)
Defines a trajectory of the light id ambiance.

traj col light

traj(ni)col(r1,g1,b1, r2,g2,b2, ...)light(id)
Defines a trajectory of the light id color.

traj foc light

traj(ni)foc(f1,f2, ...)light(id)
Defines a trajectory of the light id opening when it is a spot.

traj roll light

traj(ni)oul(r1,r2, ...)light(id)
Defines a trajectory of the light id roll when it is a spot.

traj tran

traj(ni)tran(x1,y1,z1, x2,y2,z2, ...)light(id)
Defines a displacement trajectory of the light id position.

traj tran aim light

traj(ni)tran(x1,y1,z1, x2,y2,z2, ...)aim light(id)
Defines a displacement trajectory of the aim direction of the light id type spot.

Trajectoires de rayons

Defines a trajectory during ni images over the rays of the brush id.
Options:
ext(e,c,f): with the extension (e,c,f).
period(p): period.

traj back

traj(id)animate(ni)back(r1,g1,b1, ...)

Defines the trajectory id during ni images over the color with the options.

Image trajectory

The properties of an image id may be animated by:
an encapsulated trajectory:
`traj(ni)propr(p1)image(id);`
or an animated trajectory:
```traj animate image(id)=it; assignes trajectory it to image id        traj(it)animate(ni)propr(p1,p2, ...)image(id)``` defines a trajectory during ni images over the propr property.
propr may be:

An one dimensional vectors such as:
interpol(id1,id2)
luminance(lum1, lum2, ...) luminance.
rotx(an1,an2,...)
roty(an1,an2,...)
rotz(an1,an2,...)
transp(t1,t2,...)

A two dimensional vectors such as:
dim(nx1,ny1, nx2,ny2, ...)
move(x1,y1, x2,y2, ...)

A three dimensional vectors such as:
dila(r1,g1,b1, r2,g2,b2 ...)
tran(x1,y1,0, x2,y2,0,...)

An hybride dimensional vectors such as:
transp(t1)transp(t2)col(r11,g11,b11, r12,g12,b12, ...)col(r21,g21,b21, r22,g22,b22, ...))
transp(t1,t2)luminance(a1,a2,0, b1,b2,0, ...)

A string vector such as:
`name("NNN.eee")number(n1,n2)` images named ("NNNxxxx.eee", with xxxx format("4D") in [n1,n2], ni=n2-n1+1.

Option debug.

Notes:
yes image must be enabled for trajectories of images are taken into account
the images must been validate.

Options.

See an example with the sub sub menu TRAJ_IMA of file demo1_traj.func

Other example: ```        ini traj;        image(1)dim(200);validate image(1)=1; /* Order 1: images and horizontal translation */        traj(1)animate(12,1)name("../../bmp/A.bmp")number("4D",600,611)abs(2)period(1);        traj(2)animate(12,1)tran(0,-100,0, -300,-100,0)ext(5,1)abs(2)period(1); /* Order 2: vertical translation */        traj(3)animate(12,2)tran(0,300,0, 0,0,0)abs(2);        traj animate traj(2)=3;        traj animate image(1)=1,2;        yes traj image; }```
Allowing an animation order 2 on images (assuming that the images A0600.bmp A0601.bmp ... A0611.bmp are defined).
first order: images and horizontal translation
second order: vertical translation

View trajectoires

traj aim view

traj(ni)tran(x1,y1,z1, x2,y2,z2, ...)aim view(id)
Defines a displacement trajectory on the aim direction of the view id.
traj(ni)rotx(a1,a2, ...)aim view(id)
Defines a x rotation trajectory on the aim direction of the view id.
traj(ni)roty(a1,a2, ...)aim view(id)
Defines a y rotation trajectory on the aim direction of the view id.
traj(ni)rotz(a1,a2, ...)aim view(id)
Defines a z rotation trajectory on the aim direction of the view id.

traj eye view

traj(ni)tran(x1,y1,z1, x2,y2,z2, ...)eye view(id)
Defines a displacement trajectory on the eye of the view id.
traj(ni)rotx(a1,a2, ...)eye view(id)
Defines a x rotation trajectory on the eye of the view id.
traj(ni)roty(a1,a2, ...)eye view(id)
Defines a y rotation trajectory on the eye of the view id.
traj(ni)rotz(a1,a2, ...)eye view(id)
Defines a z rotation trajectory on the eye of the view id.

traj foc view

traj(ni)foc(f1, f2, ...)view(id)
Defines a trajectory on the focal of the view id.

traj roll view

traj(ni)roll(r1,r2, ...)view(id)
Defines a trajectory on the roll of the view id.

traj T dim obj(id)

Returns the images number of the trajectory type T of the object id.

traj T NP obj(id)

Returns the number of the current images of the trajectory type T of the object id.

Examples

Displacement of object

`traj(6)tran(0,0,0, 200,0,0)vol(1)`
Builds a displacement trajectory of the volume(1).
`edit(traj tran vol(1))` prints:
0: 0 0 0
1: 40 0 0
2: 80 0 0
3: 120 0 0
4: 160 0 0
5: 200 0 0

Trajectory on the rotation axes

`traj(8)axis(0,0,1, 1,1,1, -1,1,1)vol(1)ext(1,1)`
Builds a trajectory on the rotation axes of the volume(1).
`edit(traj axis vol(1))` prints:
0: 0 0 0
1: 0.344888 0.344888 1.000000
2: 0.689775 0.689775 1.000000
3: 0.950979 1.000000 1.000000
4: 0.463234 1.000000 1.000000
5: -0.024511 1.000000 1.000000
6: -0.512255 1.000000 1.000000
-1.000000 1.000000 1.000000

Trajectory on the colors

`traj(8)col(1,.75,.5, .5,.75,1)vol(1)ext(1,1)`
Builds a trajectory on the colors of the volume(1).
`edit(traj tran vol(1))` prints:
0: 1 0.75 0.5
1: 0.928571 0.75 0.571429
2: 0.857142 0.75 0.642857
3: 0.785715 0.75 0.714286
4: 0.714286 0.75 0.785714
5: 0.642857 0.75 0.857143
6: 0.571429 0.75 0.928571
7: 0.3 0.75 1

Trajectory on the reflexion

`traj(6)illum(1,1,0, 1,.5,0, 1,1,0)vol(1)`
Builds a trajectory on the reflexion (varying between 1, 0.5 and 1) of the volume(1).
`edit(traj illum vol(1))` prints:
0: 1 0 0
1: 1 0.2 0
2: 1 0.4 0
3: 1 0.6 0
4: 1 0.8 0
5: 1 1 0

Trajectory on the (specular, gloss, transparency)

`traj(6)transp(1,0,0, 2,.1,.1, 1,0,0)vol(1)`
Builds a trajectory on the (specular, gloss, transparency) (varying between (1,0,0), (2,.1,1), (1,0,0)) of the volume(1).
`edit(traj transp vol(1))` prints:
0: 1 0 0
1: 1.4 0.04 0.4
2: 1.8 0.08 0.8
3: 1.8 0.08 0.8
4: 1.4 0.04 0
5: 1 0 0

Displacement trajectory for vertex

`traj(6)tran(0,0,0, 200,0,0)vertex(1)vol(1)`
Builds a displacement trajectory for vertex 1 of volume 1.

Trajectory of trajectory

```cube(1);traj vol(1)=1; traj(100)col(1,0,0, 0,1,0, 0,0,1)abs(2)vol(1)period(-1); traj(1)animate(ni1)tran(-300,0,0, 300,0,0)abs(2)period(1); traj traj(1)=2,3; traj(2)animate(ni2)roty(0,2*PI)abs(2)period(1); traj(3)animate(ni2)rotz(0,2*PI)abs(2)period(1);```
Builds a cube animated along a linear trajectory (-300,0,0, 300,0,0).
This trajectory rotates around the y axis and, simultaneously, around the z axis.
Note: yes traj must b active.