Return to previous page | Return to menu | Go to next page


Scale objects

The library function “slScale” is used to scale objects in the space with SGL. The parameter is passed as a scale ratio along each axis.

[void slScale (FIXED sx, sy, sz);]
Displays the object scaled for each axis.
For the parameter, substitute the scale value (arbitrary magnification) for each XYZ axis.
The object changes according to the scale value as shown in the table below.

Table 4-2 Change of object by scale value

Note) “scale” indicates the scale parameter.

Object changes with scale value

If the scale value is 0.0, the object will be drawn as having no thickness in the scaled axis direction.
Also, for negative values ​​less than 0.0, the object is drawn as a mirror image with respect to the scaled axis direction.

Listing 4-5 below shows a program that scales. The scale ratio of the square polygon in the X and Y axis directions is changed.

List 4-5 sample_4_3_4: Square polygon scaling routine

Flow 4-4 sample_4_3_4: Square polygon scaling flowchart


Return to previous page | Return to menu | Go to next page