Viewport
Several elements of an IDLgrView object control how objects appear when displayed:
- Location and Dimension — define the viewport within the destination object
- Projection — define either a parallel or perspective projection
- Eye Position — define the distance of eye from the viewing plane for perspective projections
- View Volume — define the view volume that is projected into the viewport
Location and Dimension
One of the first steps in determining how graphics objects will appear when rendered on a graphics destination object is to select the location and dimensions of the rectangular area—the viewport—on the destination in which the rendering will be displayed. Set the location and dimensions of the viewport using the LOCATION and DIMENSIONS keywords to the IDLgrView::Init method when creating the view object (or after creation using the SetProperty method).
For example, the following statement creates a view object with a viewport that is 300 pixels by 200 pixels, with its lower left corner located 100 pixels up from the bottom and 100 pixels to the right of the left edge of the destination object:
Both the LOCATION and DIMENSIONS properties of the view object honor the value of the UNITS property, which specifies the type of units in which measurements are made. (Pixels are the default units, so no specification of the UNITS keyword was necessary in the above example.)
The viewport of an existing view can be changed using the SetProperty method:
changes the location of the viewport to have its lower left corner at (0, 0) and a size of 200 pixels by 200 pixels.
Note
The eye is positioned in only one dimension (along the z-axis) and always points in the –z direction.
