next up previous
Next: Terminating block Up: Global structure of g4.prim Previous: Preamble

Modeling block

The modeling block begins with a line !BeginModeling, and ends with a line !EndModeling. Three kinds of 3D data are described between them.

1.
3D primitives, i.e, shapes and polylines
2.
Current body coordinates used to locate 3D primitives
3.
Current attributes to be assigned to 3D primitives
4.
Markers to be set to arbitrary 3D positions

The available 3D primitives, attributes, and markers are listed later together with a detailed description of their formats.

The current body coordinates are defined by the following two lines:

/Origin      Ox  Oy  Oz
/BaseVector  e1.x  e1.y  e1.z  e2.x  e2.y  e2.z

where (Ox, Oy, Oz) is the origin of the current body coordinates. Orientation of the current body coordinates is defined with a set of base vectors, i.e., x-directional base vector (e1.x, e1.y, e1.z) and y-directional base vector (e2.x, e2.y, e2.z). Z-directional base vector is defined as (e1.x, e1.y, e1.z) (e2.x, e2.y, e2.z). The base vectors need not be normalized. The origin and the base vectors are expressed in terms of the world coordinates. (There is no concept of hierarchical coordinate transformation.) The default current body coordinates, which need not be explicitly described are:

/Origin      0.0 0.0 0.0  
/BaseVector  1.0 0.0 0.0  0.0 1.0 0.0

In other words, the default current body coordinates are identical with the world coordinates.

Attributes are able to be assigned to 3D primitives. The most important one is color: /ColorRGB R G B. For example, a red box is described by putting a line /ColorRGB 1.0 0.0 0.0 before a line /Box .... Each of R (red), G (green), and B (blue) components of color should take a value between 0 and 1. The default color which need not be explicitly described is white, which is equivalent to /ColorRGB 1.0 1.0 1.0. Once current body coordinates or current attributes are set, they remain effective until they are explicitly described later again with other values.

Example: Red box centered at position (1, 2, 3)

!BeginModeling
/Origin   1  2  3  
/ColorRGB 1  0  0  
/Box 0.5   2.0   4.5  
!EndModeling


next up previous
Next: Terminating block Up: Global structure of g4.prim Previous: Preamble
Satoshi Tanaka
4/9/1998