Parasolid View Matrices   

<<< Introduction to Rendering and Faceting Chapters Display Tolerances >>>

Contents

[back to top]


49.1 Introduction

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.

[back to top]


49.2 Viewing transformation

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.

[back to top]


49.3 View matrix

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:

 

[back to top]

49.3.1 General matrix M

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.

[back to top]

49.3.2 Rotation submatrix R

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.

[back to top]

49.3.3 Perspective terms

The perspective terms Px, Py, Pz:

[back to top]

49.3.4 Array indexing

Parasolid requires 4*4 matrices to be defined in "column major" order.

 

Note: This differs from C which uses the "row-major" calling convention.

An application written in C using 4*4 matrices needs to transpose a copy of its viewing matrix before calling PK_TRANSF_create, so that the elements are sequenced in column major order i.e. with the Px, Py, Pz and S terms appearing at the end of the expanded 4*4 array sequence.

 

[back to top]

<<< Introduction to Rendering and Faceting Chapters Display Tolerances >>>