*vgl_XfmBegin - create an instance of a Xfm object vgl_XfmEnd - destroy an instance of a Xfm object vgl_XfmError - return Xfm object error flag vgl_XfmCopy - make a copy of a Xfm object
vgl_XfmComputeRotateEuler - compute Euler angles of rotation matrix vgl_XfmComputeRotateVector - compute angle and axis of rotation matrix vgl_XfmIdentity - create identity matrix vgl_XfmInvert - invert current matrix vgl_XfmLookAt - create viewing matrix vgl_XfmMult - multiply two viewing matrices vgl_XfmPurge - purge matrix of rotation, translation or scale vgl_XfmRotate - create rotation matrix about axis vgl_XfmRotateEuler - create rotation matrix given Euler angles vgl_XfmRotateVector - create rotation matrix about vector vgl_XfmScale - create scaling matrix vgl_XfmSetMatrix - create user defined matrix GetMatrix - access current matrix vgl_XfmTranslate - create translation matrix
*vgl_XfmBegin - create an instance of an Xfm object
vgl_Xfm *vgl_XfmBegin ()
None
Destroy an instance of a Xfm object using
void vgl_XfmEnd (vgl_Xfm *xfm)
Return the current value of a Xfm object error flag using
Vint vgl_XfmError (vgl_Xfm *xfm)
Make a copy of a Xfm object. The private data from the fromxfm object is copied to the xfm object. Any previous private data in xfm is lost.
void vgl_XfmCopy (vgl_Xfm *xfm, vgl_Xfm *fromxfm)
vgl_XfmComputeRotateEuler - compute Euler angles of rotation matrix
void vgl_XfmComputeRotateEuler (vgl_Xfm *xfm, Vfloat *anglex, Vfloat *angley, Vfloat *anglez)
xfm Pointer to Xfm object.
anglex Angle of rotation in radians about initial x axis. angley Angle of rotation in radians about rotated y' axis. anglez Angle of rotation in radians about rotated z'' axis.
vgl_XfmComputeRotateVector - compute angle and axis of rotation matrix
void vgl_XfmComputeRotateVector (vgl_Xfm *xfm, Vfloat *angle, Vfloat *vx, Vfloat *vy, Vfloat *vz)
xfm Pointer to Xfm object.
angle Angle of rotation in radians. vx,vy,vz Direction of vector.
vgl_XfmIdentity - create an identity matrix
void vgl_XfmIdentity (vgl_Xfm *xfm)
xfm Pointer to Xfm object.
None
vgl_XfmInvert - invert the current matrix
void vgl_XfmInvert (vgl_Xfm *xfm)
xfm Pointer to Xfm object.
None
vgl_XfmLookAt - create a viewing matrix
void vgl_XfmLookAt (vgl_Xfm *xfm, Vfloat ex, Vfloat ey, Vfloat ez, Vfloat cx, Vfloat cy, Vfloat cz, Vfloat ux, Vfloat uy, Vfloat uz)
xfm Pointer to Xfm object. ex,ey,ez Coordinates of eye point. cx,cy,cz Coordinates of reference point. ux,uy,uz Direction of up vector
None
vgl_XfmMult - multiply two viewing matrices
void vgl_XfmMult (vgl_Xfm *xfm, vgl_Xfm *xfmmult)
xfm Pointer to Xfm object. xfmmult Pointer to Xfm object.
None
xfm = xfmmult * xfm
vgl_XfmPurge - purge matrix of rotation, translation or scale
void vgl_XfmPurge (vgl_Xfm *xfm, Vint type)
xfm Pointer to Xfm object. type Specify type of component to purge =XFM_ROTATE Diagonalize rotation submatrix =XFM_TRANSLATE Zero translation components =XFM_SCALE Set scaling to unity
None
vgl_XfmRotate - create a rotation matrix
void vgl_XfmRotate (vgl_Xfm *xfm, Vfloat angle, Vint axis)
xfm Pointer to Xfm object. angle Angle of rotation in radians. axis Specify axis of rotation. =XFM_XAXIS Rotate about x axis. =XFM_YAXIS Rotate about y axis. =XFM_ZAXIS Rotate about z axis.
None
vgl_XfmRotateEuler - create rotation matrix given Euler angles
void vgl_XfmRotateEuler (vgl_Xfm *xfm, Vfloat anglex, Vfloat angley, Vfloat anglez)
xfm Pointer to Xfm object. anglex Angle of rotation in radians about initial x axis. angley Angle of rotation in radians about rotated y' axis. anglez Angle of rotation in radians about rotated z'' axis.
None
vgl_XfmRotateVector - create a rotation matrix about a vector
void vgl_XfmRotateVector (vgl_Xfm *xfm, Vfloat angle, Vfloat vx, Vfloat vy, Vfloat vz)
xfm Pointer to Xfm object. angle Angle of rotation in radians. vx,vy,vz Direction of vector.
None
vgl_XfmScale - create a scaling matrix
void vgl_XfmScale (vgl_Xfm *xfm, Vfloat sx, Vfloat sy, Vfloat sz)
xfm Pointer to Xfm object. sx,sy,sz Scale factors along x,y and x axes
None
vgl_XfmSetMatrix - create user defined matrix
void vgl_XfmSetMatrix (vgl_Xfm *xfm, Vfloat matrix4x4[4][4])
xfm Pointer to Xfm object. matrix4x4 User defined 4 by 4 transformation matrix
None
Get matrix4x4 as an output argument using
void vgl_XfmGetMatrix (vgl_Xfm *xfm, Vfloat matrix4x4[4][4])
vgl_XfmTranslate - create a translation matrix
void vgl_XfmTranslate (vgl_Xfm *xfm, Vfloat tx, Vfloat ty, Vfloat tz)
xfm Pointer to Xfm object. tx,ty,tz Translation along x,y and z axes
None
*vgl_XfmstackBegin - create an instance of a Xfmstack object vgl_XfmstackEnd - destroy an instance of a Xfmstack object vgl_XfmstackError - return Xfmstack object error flag
vgl_XfmstackLoad - load a modelview matrix onto stack vgl_XfmstackMult - multiply a modelview matrix onto stack vgl_XfmstackPop - pop the modelview matrix stack vgl_XfmstackPush - push the modelview matrix stack vgl_XfmstackProj - load the projection matrix vgl_XfmstackProject - transform to device coordinates vgl_XfmstackProjPop - pop the projection matrix stack vgl_XfmstackProjPush - push the projection matrix stack vgl_XfmstackUnproject - transform to world coordinates vgl_XfmstackSetViewport - set the viewport rectangle GetViewport - get the viewport rectangle
To use an Xfmstack object to project world coordinates to device coordinates and vice versa, use the XfmstackProject and XfmstackUnproject functions respectively. The complete viewing transformation must be set in the Xfmstack object before the projections may be performed. First the 4x4 transformation matrices representing the modelview and projection transformations must be obtained from the graphics device interface object using the vgl_DrawFunGetFloat function. Place the matrices in an Xfm object and set into the Xfmstack object using XfmstackLoad and XfmstackProj. Second query the viewport using vgl_DrawFunGetInteger. Set the viewport device coordinate limits into the Xfmstack object using XfmstackSetViewport.
*vgl_XfmstackBegin - create an instance of an Xfmstack object
vgl_Xfmstack *vgl_XfmstackBegin ()
None
Destroy an instance of a Xfmstack object using
void vgl_XfmstackEnd (vgl_Xfmstack *xfmstack)
Return the current value of a Xfmstack object error flag using
Vint vgl_XfmstackError (vgl_Xfmstack *xfmstack)
vgl_XfmstackLoad,vgl_XfmstackMult - load and multiply the modelview matrix
void vgl_XfmstackLoad (vgl_Xfmstack *xfmstack, vgl_Xfm *xfm) void vgl_XfmstackMult (vgl_Xfmstack *xfmstack, vgl_Xfm *xfm)
xfmstack Pointer to Xfmstack object. xfm Pointer to Xfm object.
None
vgl_XfmstackPop,vgl_XfmstackPush - pop and push modelview transformation stack
void vgl_XfmstackPop (vgl_Xfmstack *xfmstack) void vgl_XfmstackPush (vgl_Xfmstack *xfmstack)
xfmstack Pointer to Xfmstack object.
None
vgl_XfmstackProj - load current projection matrix
void vgl_XfmstackProj (vgl_Xfmstack *xfmstack, vgl_Xfm *xfm)
xfmstack Pointer to Xfmstack object. xfm Pointer to Xfm object.
None
vgl_XfmstackProject,vgl_XfmstackUnproject - transform device coordinates
void vgl_XfmstackProject (vgl_Xfmstack *xfmstack, Vfloat wx, Vfloat wy, Vfloat wz, Vfloat *dx, Vfloat *dy, Vfloat *dz) void vgl_XfmstackUnproject (vgl_Xfmstack *xfmstack, Vfloat dx, Vfloat dy, Vfloat dz, Vfloat *wx, Vfloat *wy, Vfloat *wz)
xfmstack Pointer to Xfmstack object. wx,wy,wz World or object coordinates. dx,dy,dz Device or window coordinates
dx,dy,dz Device or window coordinates wx,wy,wz World or object coordinates.
vgl_XfmstackProjPop,vgl_XfmstackProjPush - pop and push projection matrix stack
void vgl_XfmstackProjPop (vgl_Xfmstack *xfmstack) void vgl_XfmstackProjPush (vgl_Xfmstack *xfmstack)
xfmstack Pointer to Xfmstack object.
None
vgl_XfmstackSetViewport - set the viewport rectangle
void vgl_XfmstackSetViewport (vgl_Xfmstack *xfmstack, Vint left, Vint right, Vint bottom, Vint top)
xfmstack Pointer to Xfmstack object. left, right Device coordinates of left and right planes of viewing volume bottom, top Device coordinates of bottom and top planes of viewing volume
None
Get left, right, bottom, top as an output arguments using
void vgl_XfmstackGetViewport (vgl_Xfmstack *xfmstack, Vint *left, Vint *right, Vint *bottom, Vint *top)