 |
PK_TRANSF_create_view |
|
PK_ERROR_code_t PK_TRANSF_create_view
(
--- received arguments ---
PK_VECTOR1_t view_direction, --- view direction
--- (normalised)
const PK_TRANSF_create_view_o_t *options, --- option structure
--- returned arguments ---
PK_TRANSF_t *const transf --- the view transform
)
This function returns a valid viewing transform given a unit vector that
designates the desired 'view_direction'. Optionally an 'eye_position' can be
provided via the options structure in order to add perspective behaviour to the
transform. This can be done by setting the flag 'have_eye_position' to
PK_LOGICAL_true.
Note: This function supersedes PK_VECTOR_make_view_transf.
This function accepts a normalised direction vector and creates a viewing
transform entity from it with zero translation and perspective components,
unit scale and a rotation sub matrix with determinant 1.
The viewing matrix is right handed.
The following table describes the view matrix in "column major" order
(using the notation of the Parasolid Functional Description manual).
[ Hi Vi Di Px=0.0 ]
[ Hj Vj Dj Py=0.0 ]
[ Hk Vk Dk Pz=0.0 ]
[ Tx=0.0 Ty=0.0 Tz=0.0 Sc=1.0 ]
The rotation sub matrix defines 3 three orthogonal axes H, V, D where
D = -( 'view_direction' )
and V and H are calculated so that when D is parallel to a principal
axis, these vectors will be parallel to the other two principal axes.
In addition, one can add a perspective scaling to the view matrix by setting
the 'have_eye_position' option to true and providing an appropriate eye
position from which to view the part along the view direction already given.
It is important that this location be such that all parts are visible in this
direction when using the view matrix for rendering parts. It must be located
outside of the volume bounding all visible parts to be rendered.
For more detailed information refer to the Parasolid Functional Description:
Parasolid View Matrices.