The following appendix was taken from Extentions to the graphical interpretation of L-Systems based on turtle geometry by R. Mech and P. Prusinkiewicz.
The graphical extensions described in the text include not only new modules with a specific interpretation but also several view file commands setting initial parameters of the graphical interpretations:
contour sides: defines the number of polygons drawn around a contour;
twist of cylinders: switches on or off the twist minimizing method applied during the visualization of generalized cylinders;
texture: specifies the texture and the way it is mapped on a surface.
Contours are specified in the view file by the command:
The number of polygons around a contour can also be set in the view filw by command:
The contour file has the following syntax: the first line contains a number of control points, the dimension of the contour (2 or 3), and a identifier of an open or closed contour (the word open or closed). Subsequent lines contain two or three coordinates of control points, one point per line.
A two-dimensional contour is specified by the file:
12 2 closed 0.166482 -1.123751 0.416204 -1.040511 0.582686 -0.332963 1.082131 -0.041620 1.082131 -0.499445 0.499445 0.541065 0.332963 0.915649 -0.374584 1.040511 -0.707547 0.624306 -1.123751 0.166482 -0.874029 -0.749168 -0.416204 -0.665927
A three-dimensional contour is specified by the file:
12 3 closed 0.166482 -1.123751 1.0 0.416204 -1.040511 0.0 0.582686 -0.332963 0.0 1.082131 -0.041620 0.0 1.082131 -0.499445 0.0 0.499445 0.541065 0.0 0.332963 0.915649 0.0 -0.374584 1.040511 0.0 -0.707547 0.624306 0.0 -1.123751 0.166482 0.0 -0.874029 -0.749168 0.0 -0.416204 -0.665927 0.0
An open contour is defined by the file:
15 2 open -0.914286 -0.400000 -0.914286 -0.400000 -0.914286 -0.400000 -0.871429 -0.342857 -0.742857 -0.171429 -0.457143 -0.085714 -0.285714 0.142857 0.000000 0.271429 0.228571 0.114286 0.514286 0.142857 0.657143 -0.028571 0.892857 -0.114286 0.971429 -0.142857 0.971429 -0.142857 0.971429 -0.142857
Note that the first and the last control point is repeated three times to make sure the contour finishes in the given points.
It is possible to create a two-dimensional contour in a drawing program xfig and convert it to the contour text file using a conversion utility fig2con. It is necessary to use either open or closed Bezier spline for the contour coordinates. The created xfig file can be converted using the command:
Textures are specified in the view file using a command texture:
near (or n only) - the texture image is not smoothened, thus texture pixels can appear as big as squares.
near (or n only) - just one texture pixel is used to compute the color of a given pixel on the screen. This mode is faster but can produce some aliasing effects.
decal (or d only) - the color of the texture pixel is used as the color of the surface;
As a default, the texture is mapped onto each patch. In this case, texture coordinates are derived from s and t coordinates of the parametric equation of the Bezier patch representing the surface (both s and t goes from 0 to 1). In the case of mapping onto the whole surface, the surface boundaries along x and y axes are found and the texture is mapped into z-plane so that it fits the surface bounding box in x and y coordinates.
Tropisms and twists are specified in the view file using commands tropism or torque:
torque:T: vector E: initial_elasticity S: elasticity_increment
Preface Parameters Appendix I Appendix II References |
|||||
---|---|---|---|---|---|
Index | Circles and Spheres | Generalized Cylinders | Surfaces | Textures |