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


Viewing volume

The area projected on the projection plane is called the viewing volume.
In the case of SGL, the angle of view and display level are the parameters that control this viewing volume.
Here are two of them.

1) Angle of view
Perspective is a parameter that determines how much of the image is projected on the projection plane in the horizontal direction with the viewpoint as the origin.
Increasing this value increases the density of the object projected on the projection surface, resulting in an image that looks just like a fisheye lens.
Note that the vertical spread is determined by the angle of view value and the resolution of the screen mode.

Figure 4-5 Angle of view image model

Use the function “slPerspective” to change the perspective settings on SGL.

[void slPerspective (ANGLE perspective_angle);]
By changing the parameters of this function, you can control the spatial area projected onto the projection plane.
For the parameter, substitute an angle value (10

Figure 4-6 Image differences depending on angle of view

2) Display level The
display level is a parameter that determines how far behind the projection plane is to be projected.
Objects behind the projection plane are also projected onto the projection plane in the same way as the images behind the projection plane.

The display level is set with the function “slZdspLevel”.
The display level is determined by the projection point from the viewpoint and projection plane.

[void slZdspLevel (Uint16 level);]
Determines the display level of the viewing volume.
For the parameter, substitute the values ​​in the table below according to the display level.

Table 4-1 Display level substitution value (level)

The figure below shows the display level image model.

Figure 4-7 Display level

Listing 4-1 below shows how the cube looks by placing a cube in the center of the screen and changing the angle of view parameter, which is a perspective parameter, between 20 and 160 degrees.

List 4-1 sample_4_2: Changes in video by perspective

Flow 4-1 sample_4_2: Flow chart of video change by perspective


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