GENERAL DESCRIPTION OF ANYFLO



PRINCIPLE
OBJETS
TRANSFORMATIONS
INTERACTION

















































PRINCIPLE

     Language
     Grahic
     Animation
     Interaction

Language

          Multiplicity of a command
          Evaluation
          Assignment
          Actions

         The internal language ANYFLO is an simplified extension of the C language, in addition to the features of this language, it has hundreds of commands being able constitute syntactically correct expressions and being interpreted.
         Default anyflo speak "English" to make him speak another language just translate command files (koma.h, komb.h, komc.h) and message files (mesa.h, mesb.h, mesc.h).
         It is possible to make him speak several languages at the same time, just define alias to commands in files kom*. h
For example write in komb.h:
1: screen ecr
screen and ecr are two names for the same command (clear screen).
Multiplicity of a command
Simple commands:
A simple command is a command name optionally followed by parameters.
Examples:
screen;
         Clears the screen with the background color.
screen(r,g,b);
         Clears the screen with color (r,g,b).

Multiple commands:
A multiplecommand is a sequence of command names with optionally parameters parenthesized. Its effect depends on the first word of the command can be:
1) A word in anyflo language.
2) An object obj(id), other commands specify the design parameters of the object obj type and identifier id.
3) An object property.
4) A transformation(pi), pi are the parameters of the transformation, other commands specify the parameters for its application.
5) Other commands such as interaction, mouse, ... undertaking certain actions.
Examples:
alea(10,20,30)vol(1);
         disrupts the volume 1 by reproducible randoms with coefficients between -10 and 10 for x, between -20 and 20 for y and between -30 and 30 for z.
cube(1)dim(100,150,200)col(1,0,0);
         Built the parallelepipede number 1 dimensions (100 150 100) and red color.
col vol(1)=1,.8,.4;
         Gives to volume number 1 an orange color.
interaction("rotxzeye");
         Switches to interaction mode involving the left mouse button to rotate the x and z eye.
Evaluations
A command com1 (p1) com2 (p2) .... comn (pn) is evaluated, ie it returns a value.
Exemples:
poi(3) vol(1);
         Returns the coordinates of point 3 of volume 1.
w=poi(3) vol(1);$w;
         Prints the coordinates of point 3 of volume 1.
Assignment
A commande com1 com .... obj(id)=val assigns value val to the property com1 com2 ... of object id type obj.
Examples:
poi(3) vol(1)=100,50,0;
         Assigns (100,50,0) to point 3 of volume 1.
col vertex(3) vol(1)=0,1,0;
         Assigns green color to vertex 3 of volume 1.
Actions
Some commands initiate action.
Examples:
screen(r,g,b);
         clears the screen with color (r,g,b).
alea(20)vol(1);
       Disrupts, with random 20, the volume number 1.

Grahique

       2D
       3D
2D
A set of graphic commands provide direct access to the bitmap graphic card:
frame
screen
menu
message
brush
pixel
rectangle
segment
text

3D
Command displ allows displaying a variety of onbjects.

A set of commands allow to define 3D objets , transform them and animate them interactively.

Animation

All properties of objects can be changed over time by either procedurally executing functions or by trajectories, either interactively or finally using connectionist or evolutionary methods.

Interaction

A call to MainLoop() OpenGL (with call backs providing interactive control) enables real-time with the possibilities of graphic card installed on the machine.

OBJECTS

    The language objects
    General objects
    Standard objects
    Identifier
    Object properties
    Access to object properties
    

The language objects

Strings, example "AB"
String arrays, example: "MOT1 MOT2 MOT3"
Float number, example: 1.0
Number arrays, example (1,2.5,-1.0,.3)
Hybrid arrays, example: 1,2,3,"ABCD",4,"EF"
Variables, example x=[1,5], they can be global, static or local
User-written functions
mathematical functions, examples cos, sin, log

General objects

The most general object is defined by its type, which is a word defined by type("ttt")=num.
Examples:
object("obj1")type("type1") builds the object name obj1 and type type1.
The type may be implicitly defined during the creation of an object.

Standard objects

Standards objects of interpreter:
         compile: compilation.
         func: function.
         var: variable.
         history: history.

Standards objets of anyflo:
         audio(id): audio object.
         brush: 2D graphic object.
         device: connections to the sensors.
         field: force field.
         fog.
         font.
         genetic: genetic populations.
         image.
         light.
         memory.
         menu.
         message.
         network: neural network.
         object.
         palette.
         scale.
         see.
         sphere: particular object type sphere.
         stock: stock directive.
         text.
         traj: trajectory.
         vol: volume.
         view.
         win.

Specific volumes can be declared directly:
         ball: polyhedral approximation of a sphere.
         cube: cuboids.
         envelope: envelope of several volumes.
         geod: surface defined by geodesic curves.
         grid.
         prism.
         sphere: default defined sphere.
         rev: surface of volution.
         pipe.

Identifier

Objects are known to their creation by their identifier which is either an integer no zero (their number) or a string of characters (their name).
Example:
cube(7)dim(100)
       Builds a cube number 7 side 100100.
ball("B1")radius(100)secy(6)secx(18)
       Builds a ball named B1, radius 100, 6 y sections and 18 x sections.

Object properties

Objects can be equipped with any number of arbitrary properties. When created certain properties can be set automatically.
Example:
cube(7) dim(200);
Creates object type cube having:
         Property poi containing 8 points.
         Property fac containing 6 facets.
After creating an object properties can be added to it, eg:
col vol(7)=1;
         Assigns the color red to volume 7.
poi(0) vol(7)=0,0,0;
         Adds point (0,0,0) to voulme 7.

Access to Object properties

Evaluation:
poi(3) vol(1);
         Returns the coordinates of point 3 of volume 1.
col vertex(3) vol(1);
         Returns color (r,g,b) of vertex 3 of volume 1.
Assignment:
poi(3) vol(1)=100,50,0;
         Assigns value (100,50,0) in point 3 of Volume 1.
col vertex(3) vol(1)=0,0,1;
         Assigns the bleu color at vertex 3 of Volume 1.
Creation:
col screen vol(1)=1,0,1;
         Creates property col screen of volume 1 and assigns to it the value (1,0,1).

Visibility of an object

validate object(id)obj returns:
1 if object is valide.
0 if object is invalide.
NIL if object does not exist.

TRANSFORMATIONS


     Linear transformations of objects by the matrix
     Transformations of object points
     The transformation commands
     Encapsulation

Linear transformations of objects by the matrix

         They affect only matrix of the object leaving invariant the coordinates of its points.
Syntaxe:
T matrix vol(id)
Returns the coefficients p of transformation T.
T(p)matrix vol(id)
Assigns p to coefficients of transformation T.
T is a linear transformation: TRAN, DILA, DILX, DILY, DILZ, HOM, ROTA, AXE, ROTX, ROTY, ROTZ.
Examples:
tran(100,0,0)matrix vol(1);: displacement.
rota(.25*PI)matrix vol(1);axis(1,-1,1)matrix vol(1);: rotation around axis (1,-1,1).
dila(1,2.5,-1)matrix vol(1);:y dilatation and z symmetry.

Transformations of object points

         They affect coordinates of the object points.
Syntaxe:
T(p)vol(id); all vertices.
T(p)vertex(s)vol(id); only vertices s.
Examples:
tran(100,0,0) vol(1);
         displaces volume 1 by (100,0,0).
rand coe(20)vertex[1,5]vol(1);
         Disturbs by 20 the vertices 1 to 5 of volume 1.

The transformation commands

See the transformations list.

Encapsulation

The attach command encapsulates the properties of an object that will be executed when using this object (the display for a volume, the calculation of the perspective view, an illumination model for light).
Syntaxe:
attach(0)P(p)vol(id);
       Attaches the property P(p) to the volume id, it will then be executed automatically at each step of a dynamic animation.
Example:
attach generate ext vol(id): In interaction mode, the extension of volume id will be recalculated before each display (useful if the volume is deformable).

INTERACTION

interaction
real time By default, the dialogue takes place via the keyboard.
To switch to real-time interaction type interaction, dialogue can then be done via the mouse, the menus, launch interaction mode or see mode, which is a combination of the two modes (keyboard and interaction) since it is in real time and a dialog to type commands in parallel with the execution.

Real time

The very general structures of anyflo are translated (by a compiler of data transparent to the user) in fixed compact structures compatible with the functions of OpenGL and DirectX.
Note:
With no illum:
yes segment speeds up the calculations, but precomputations are longer.
simple vol(id)=1 deals only with the wired for the volume id, no attachs, no motif, no particles, no envelope vertex, no local, no vertex sphere , no vol vertex.