Next: Defining Lights Up: Programmer's Reference for the Previous: Window Configuration

Defining the View

Objects which are drawn into the graphics window first undergo a transformation based on the current view type. There is also the concept of a current viewport, which is the section of window in which drawing will occur.

public  void  G_set_viewport(
    Gwindow        window,
    int            x_min,
    int            x_max,
    int            y_min,
    int            y_max )

Sets the area of display within the current window, in pixels. All objects will be drawn into this area of the window.

public  void  G_set_view_type(
    Gwindow         window,
    View_types      view_type )

Sets the current view method to one of PIXEL_VIEW, SCREEN_VIEW, WORLD_VIEW, or MODEL_VIEW.

public  void  G_set_3D_view(
    Gwindow        window,
    Point          *origin,
    Vector         *line_of_sight,
    Vector         *up_direction,
    Real           front_clip_distance,
    Real           back_clip_distance,
    BOOLEAN        perspective_flag,
    Real           perspective_distance,
    BOOLEAN        stereo_flag,
    Real           eye_separation,
    Real           window_width,
    Real           window_height )

Defines the three dimensional view, in terms of the position of the viewer's eye (origin), the direction of view (line_of_sight), and the upwards direction (up_direction). The distance to the front and back clipping planes are specified, as well as whether the view is a perspective projection or not, and the distance to the perspective view plane. The stereo_flag and eye_separation are currently not supported, and should be set to FALSE and 0.0. The window_width and window_height specify the size of the virtual screen in the 3D scene world.

public  void  G_set_modeling_transform(
    Gwindow         window,
    Transform       *transform )

Sets the extra modeling transformation associated with the MODEL_VIEW view mode.

public  void  G_push_transform(
    Gwindow      window,
    Transform    *transform )

Adds an extra transform to the transformation stack, which all subsequently drawn objects will undergo. It saves the current one, which can be restored by calling:

public  void  G_pop_transform(
    Gwindow    window )

Reverts to the previous transformation (just before the most recent G_push_transform().

public  void  G_transform_point(
    Gwindow         window,
    Point           *point,
    View_types      view_type,
    int             *x_pixel,
    int             *y_pixel )

Determines where a specified point will appear in the window, if it were to be drawn with the specified view type.

Next: Defining Lights Up: Programmer's Reference for the Previous: Window Configuration
Fri Feb 17 15:39:43 EST 1995