|
||
W-Space, C-space, and E-Space
The W-Space coordinate system corresponds to the standard Cartesian coordinate system. C-Space refers to a three-dimensional coordinate system that can be oriented anywhere in the world coordinate system.
Interactive users frequently use C-Space for their drawing activities. E-Space is a local coordinate system that is stored with each entity. When an entity is created, the E-Space of the entity is initialized to the C-Space that is current at the time that the entity is created. When an entity is rotated or moved, the E-Space of the entity is also rotated or moved along with the entity.
There are a number of commands that can be used to define a C-Space. Two of these commands are illustrated below. The first command defines the C-Space according to an origin point and the direction of the x and y axes. The second command aligns the C-Space to the E-Space of a object with the name \room2\wall2.
In application programs, it is very useful to be able to execute SilverScreen commands relative to C-Space. The following two commands draw lines in W-Space.
By enclosing the coordinates by square brackets, the points are interpreted to be C-Space points. The first command below will draw a line between C-Space points 2,3,4 and 1,1,5. This is shown below.
An Example
The orientation of the frame is determined by the parameters origin, xaxis, and yaxis. The lower left corner of the frame will be constructed at origin. The frame will extend to the right in the direction of xaxis, and will extend upward in the direction of the yaxis.
The draw_frame function begins by aligning the C-Space to the parameters origin, xaxis, and yaxis. Four polygons are then drawn within the object temp. Note that the function draw_polygon draws these points in C-Space. The solids are then created by sweeping all four polygons in a single operation. The direction and depth of the sweep is determined by the C-Space points [0,0,0] and [0,0,d]. This specifies a sweep of distance d along the z-axis of the C-Space.
|
|
|||||||||
|