|
Graphics.Rendering.OpenGL.GL.CoordTrans | Portability | portable | Stability | stable | Maintainer | sven.panne@aedion.de |
|
|
|
|
|
Description |
This module corresponds to section 2.11 (Coordinate Transformations) of the
OpenGL 2.1 specs.
|
|
Synopsis |
|
|
|
|
Controlling the Viewport
|
|
|
After clipping and division by w, depth coordinates range from -1 to 1,
corresponding to the near and far clipping planes. depthRange specifies a
linear mapping of the normalized depth coordinates in this range to window
depth coordinates. Regardless of the actual depth buffer implementation,
window coordinate depth values are treated as though they range from 0
through 1 (like color components). Thus, the values accepted by depthRange
are both clamped to this range before they are accepted.
The initial setting of (0, 1) maps the near plane to 0 and the far plane to
1. With this mapping, the depth buffer range is fully utilized.
It is not necessary that the near value be less than the far value. Reverse
mappings such as (1, 0) are acceptable.
|
|
|
A 2-dimensional position, measured in pixels.
| Constructors | | Instances | |
|
|
|
A 2-dimensional size, measured in pixels.
| Constructors | | Instances | |
|
|
|
Controls the affine transformation from normalized device coordinates to
window coordinates. The viewport state variable consists of the coordinates
(x, y) of the lower left corner of the viewport rectangle, (in pixels,
initial value (0,0)), and the size (width, height) of the viewport. When
a GL context is first attached to a window, width and height are set to
the dimensions of that window.
Let (xnd, ynd) be normalized device coordinates. Then the window
coordinates (xw, yw) are computed as follows:
xw = (xnd + 1) (width / 2) + x
yw = (ynd + 1) (heigth / 2) + y
Viewport width and height are silently clamped to a range that depends on the
implementation, see maxViewportDims.
|
|
|
The implementation-dependent maximum viewport width and height.
|
|
Matrices
|
|
|
A matrix stack.
| Constructors | Modelview GLsizei | The modelview matrix stack of the specified vertex unit.
| Projection | The projection matrix stack.
| Texture | The texture matrix stack.
| Color | The color matrix stack.
| MatrixPalette | The matrix palette stack.
|
| Instances | |
|
|
|
Controls which matrix stack is the target for subsequent matrix operations.
The initial value is (Modelview 0).
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
| Methods | | | Instances | |
|
|
|
| Methods | | Create a new matrix of the given order (containing undefined elements)
and call the action to fill it with 4x4 elements.
| | | Call the action with the given matrix. Note: The action is not
allowed to modify the matrix elements!
| | | | |
| | Instances | |
|
|
|
|
|
|
|
|
|
Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
Push the current matrix stack down by one, duplicating the current matrix,
excute the given action, and pop the current matrix stack, replacing the
current matrix with the one below it on the stack (i.e. restoring it to its
previous state). The returned value is that of the given action. Note that
a round-trip to the server is probably required. For a more efficient
version, see unsafePreservingMatrix.
|
|
|
A more efficient, but potentially dangerous version of preservingMatrix:
The given action is not allowed to throw an exception or change the
current matrix mode permanently.
|
|
|
|
|
|
Normal Transformation
|
|
|
If rescaleNormal contains Enabled, normal vectors specified with
normal are scaled by a scaling
factor derived from the modelview matrix. rescaleNormal requires that the
originally specified normals were of unit length, and that the modelview
matrix contains only uniform scales for proper results. The initial value of
rescaleNormal is Disabled.
|
|
|
If normalize contains Enabled, normal vectors specified with
normal are scaled to unit length
after transformation. The initial value of normalize is Disabled.
|
|
Generating Texture Coordinates
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
Produced by Haddock version 0.9 |