next up previous contents index
Next: Reading/writing a graph Up: Reading/writing an environment Previous: Reading a description

Creating and reading a macro

A macro is a specific MIF file containig the description of an obstacle or a robot. Once a macro file has been written, a scene can contain as many copies of the element described in the macro file as wanted. For example, if the user wants to describe a class room, instead of describing every single chair and table, the user can create two macro files chair.macro and table.macro, and create his classroom using only the command p3d_read_macro object.macro name.

This command will call the function int p3d_read_macro(char *namemac, char *nameobj) that is quite similar to the function p3d_read_desc and will create the robot or obstacle contained in the macro file. Then the user has just to place the obstacle or robot in its right position in the scene.

A macro file is very similar to a general MIF file except that there is no environment description and the obstacle or robot described in the macro file has no name.



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