Modulefpreviousupnextcontents[BIG][Normal][small]
Next: 4.5 3D graphics instructions Up: 4 Creating a 3D image Prev: 4.3 3D transformations Contents


4.4 The transformations

As seen before, it corresponds to first of all positioning the observer with respect to the object. In case of stacking PUSHes and PULLs, it corresponds to positioning an object with respect to another.

Let us take an example: Suppose that we construct the following object composed of two separate objects: PIECE A, a cube with center of gravity 'O' and PIECE B, a cylinder glued onto one of its faces. We can proceed with its description in two different ways:

Method I:
We describe the cube and cylinder directly at their respective positions by entering the coordinates of the points in the general coordinate system.

Method II:
We first describe the cube in its own coordinate system. Then we describe the cylinder in its own coordinate system. We then perform transformations on the coordinate system of the cylinder to position it in the coordinate system of the cube.

However, in both cases, we must first position the observer with respect to the object.

Let us adopt the following vocabulary:

Calling object:
initial object (the cube)
Called object:
object undergoing the transformations (the cylinder)

A very simple manner to position the observer in the initial space is to use the following subroutine:

      SUBROUTINE NRMLST(XO, YO, ZO, XR, YR, ZR, IVERTI)
      REAL XO, YO, ZO, XR, YR, ZR
      INTEGER IVERTI
where:

(XO, YO, ZO) is the  position of the observer in the initial coordinate system;

(XR, YR, ZR) represent the coordinates of the point viewed in the same coordinate system;

IVERTI is the vertical of the initial coordinate system, such that:

.
IVERTI = 1 : OX vertical
.
IVERTI = 2 : OY vertical
.
IVERTI = 3 : OZ vertical

We can thus associate a local coordinate system with the observer so that he/she is positioned at its origin, looking in the negative Z direction. This is the normalized position of which we spoke earlier.

Subroutine NRMLST is generally used in conjunction with "PRSPCT".

 
Figure 4.4: Coordinates corresponding to the observer 

The various transformations that can be applied to the called objects are listed below:


Modulefpreviousupnextcontents[BIG][Normal][small]
Next: 4.5 3D graphics instructions Up: 4 Creating a 3D image Prev: 4.3 3D transformations Contents