next up previous contents index
Next: Description of a robot Up: Description of an obstacle Previous: General polyhedron

Geometric primitives

The geometric primitives are all described in the same way : the function void p3d _add_desc_type(char name[20], parameters)   is called, parameters being the right parameters for the type of primitive we choose (size of the side fo a cube, ray for a sphere,...). The function p3d_add_desc_type calls the void p3d_create_type(char name[20], parameters)  function with the name prim and the parameters as imputs, stores this new polyhedron as the current polyhedron of the object, places it in the array of polyhedrons of the current object and updates the number of polyhedron of the current object and its bounding box.

The different types of geometric primitives available in Move3D are shown in Fig. gif.

  
Figure: The geometric primitives proposed in Move3D

A geometric primitive is always described with its center placed to the point (0,0,0) in the frame of the environnement. So we often have to put them in their right position, using the function void p3d_set_prim_pos(char name[20], double tx, double ty, double tz, double rx, double ry, double rz)   that modify the position matrix of the primitive. The parameter prim is the name of the primitive we want to move, (tx, ty, tz) the translations along the 3 axes, and (rx, ry, rz) the rotations along the 3 axes (first rx then ry then rz). This function can also be used for a general polyhedon.

Once all the polyhedron of the object have been described, the function p3d_end_desc() is called, that calls this time the function int p3d_end_obj(void)  . This function stores the current object in the array of obstacles of the current environment if its type was P3D_OBSTACLE.

After its description, a whole obstacle can be moved using the function void p3d_set _obst_pos(char name[20], double tx, double ty, double tz, double rx, double ry, double rz)   is called, wich use is exactly the same than p3d_set_prim_pos.


next up previous contents index
Next: Description of a robot Up: Description of an obstacle Previous: General polyhedron

Nicola Simeon
Fri Oct 27 09:07:38 MET DST 2000