attach


attached property


Principe
Syntaxe
Examples
See also

















































Principe

       Any multiple command com1(p1) obj(id) com2(p2) ... comn(pn) can be encapsulated in the object id by:
attach(0)com1(p1) obj(id) com2(p2) ... comn(pn)
This command will be executed automatically each frame of an animation.
Notes:
1) The parameters pi are evaluated during encapsulation and therefore can not vary.
2) For varying run com1(p1) obj(id) com2(p2) ... comn(pn) in a callback or function reference in a local object id.
3) Such a statement is executed at the display and is characterized by a flag:attach: returns the flag (1: running, 0: execution completed).attach (f) to force this flag.
Such instruction is executed when displayinglors and returns a flag:
attach: returns the flag (1: running 0: execution completed).
attach(f): attach (f) to force this flag.
yes attach is needed.















































Syntaxe

attach(0)com1(p1)...obj(id)...

Adds the property attach attach com1(p1)...obj(id)... to block attach the object id of type obj.
Options:
abs: if the same property has already been created, it is only modified, otherwise it is added.
back: performs attach after matrix calculation (default).
front: performs attach befor matrix calculation.
Comments:
1) Specify this option if you want to add properties differing only in their parameters, such as:
attach(0)vertex(1,2,3)vol(1)vertex(1,2,3)vol(2);
attach(0)vertex(4,5,6)vol(1)vertex(1,2,3)vol(3)abs;

2) By cons do not specify if you want to modify the settings of an existing property, such as:
attach(0)vertex(1,2,3)vol(1)vertex(1,2,3)vol(2);
to the next image you want to move these vertices on vertices (4,5,6) of volume 2:
attach(0)vertex(1,2,3)vol(1)vertex(4,5,6)vol(2);
3) attach(0)interpol secx(x1,x2)vol(id) is performed prior to the display, which enable the treatment of other properties such as envelope vertex.

attach(num)vol(id)

Returns the property number num of the block attach of volume id.
Comment: it is a string of characters, valid only for consultation, and can not be used as property.

attach(num)com1...vol(id)...

Modifies this property.















































Examples

Display
Extension
Variable parameters of a volume
Adaptative view
Other examples

Display vertices

attach(0)displ vertex(0)vol(id);
       displays vertices s of volume id (all vertices if s=0 or is absent).

Extension on a deformable volume

If a volmue id is provided with an extension and that the geometry of the control points is changed do:
attach(0)generate ext vol(id);
Comments:
1) Same for fractal.
2) yes attach, yes ext must be activated. or yes frac.

Variable parameters of a volume

Changes in certain parameters of a volume (or vertices of this volume) variations may depend on other settings from another volume (see associated transformations:
attach(0)vertex(s1)T1(p11,p12)vol(id1)T2(p21,p22)vol(id2);
       In animation parameters T1 of vertices s1 of volume id1 vary between p11 and p12 when the parameters T2 of volume id2 vary between p21 and p22.
attach(0)exec("instructions list")vol(id); can execute instructions list each image.

Adaptative view

attach aim poi(x,y,z)spring(.1,-.1)dist(200)view(1);
defines an adaptive dynamic view of a spring designed to bring the aimpoint to (x, y, z).
attach aim vol(1)spring(.1,-.1)dist(200)view(1);
defines an adaptive dynamic view of a spring designed to bring the aimpoint to the center of gravity of volume 1.

Other examples

Any display control involving object possibly transformed by the matrix, as displ axis vol, ignores this transformation to take them into account encapsulate attach displ axis vol(id) that will be executed when the volume display.

attach(0)dila(1,1,1, 2,1,3)vertex[6,12]ini vol(2)rota(0,PI)vol(2);
Coordinates of vertices [6,12] of volume 2 will be multiplied by (x,y,z) (between (1,1,1) and (2,1,3)) when its angle varies in (0,PI).

a=limit rota vol(humerus_g);attach(0)rotz(-PI,0)vol(radius_g)rota(a)vol(humerus_g)coe(2);
Rotates volume radius_g according to the rotation of volume humerus_g.

a=limit rota vol(humerus_g);attach(0)rotz(-PI,0)vol(radius_g)rota(a)vol(humerus_g)coe(2);
Rotates volume radius_g according to the rotation speed of volume humerus_g.















































See also

edit attach
exec attach
ini attach
no attach
yes attach