<<< Introduction to Rendering and Faceting | Chapters | Display Tolerances >>> |
Parasolid specifies the viewing data (position, direction and type) for rendering and faceting functions using a view matrix. This chapter describes the general form of such a matrix.
A viewing transformation is needed when:
The view matrix referenced by the viewing transformation entity is constructed such that:
A perspective view is generated if the view matrix contains non-zero perspective terms.
A view matrix is a PK transformation entity, which is created from a PK_TRANSF_sf_t structure containing a 4*4 homogeneous matrix. The viewing matrix M operates as a post-multiplier on row vectors containing homogenous coordinates:
The general matrix M consists of:
This notation is used by Newman and Sproull in one of the standard texts, "Principles of Interactive Computer Graphics" (McGraw-Hill 1973).
The support function PK_VECTOR_make_view_transf creates a suitable viewing matrix for the rendering functions which incorporates a specified view direction.
The rotation submatrix R defines an orthogonal set of vectors H, V and D:
The matrix M must satisfy the following constraints:
When constructing a view matrix the vector D is the negated view direction (this is because all Parasolid matrices are defined as right handed).
The other two vectors, V and H (nominally called vertical and horizontal) define the basis of the viewing coordinate system.
The perspective terms Px, Py, Pz:
Parasolid requires 4*4 matrices to be defined in "column major" order.
Note: This differs from C which uses the "row-major" calling convention. |
<<< Introduction to Rendering and Faceting | Chapters | Display Tolerances >>> |