IBM Visualization Data Explorer Programmer's Reference

[ Bottom of Page | Previous Page | Next Page | Table of Contents | Partial Table of Contents | Index ]

DXGetCameraMatrix, DXGetCameraRotation, DXGetCameraMatrixWithFuzz

Function

Return matrices that represent stages of the viewing operation.

Syntax

#include <dx/dx.h>


Matrix DXGetCameraMatrix(Camera c)
Matrix DXGetCameraRotation(Camera c)
Matrix DXGetCameraMatrixWithFuzz(Camera c, float fuzz)

Functional Details

A camera defines the position and orientation of the viewer, the volume of interest of the object being viewed, and the size of the image to contain the resulting view.

Conceptually, there are three steps to converting an object in 3-dimensional space to an image in two-dimensional space:

  1. Translate the Object and camera as a unit so that From is at the center of the image, rotate them until up is aligned with the image y axis, and the from-to vector is perpendicular to the image.

    DXGetCameraRotation, given camera c, returns the matrix that performs this series of transformations.

  2. Scale the size of the volume of interest to the size of the image. (For additional details, see DXSetPerspective and DXSetOrthographic.)

    DXGetCameraMatrix and DXGetCameraMatrixWithFuzz, given camera c, return the matrices that perform this step and the previous step. DXGetCameraMatrixWithFuzz returns the matrix with a given fuzz applied. The fuzz allows an object that is coincident with a second object, to be moved forward slightly to allow it to appear in front of the second object. An example of this would be displaying contour lines on a surface; a positive fuzz applied to the lines make the lines appear displayed slightly in front of the surface.

  3. For perspective cameras only, make the walls of the volume interest parallel. (For additional details, see DXSetPerspective.)

When these three steps are completed, the object has the correct image x,y coordinates and can be rasterized.

Return Value

Return the matrix.

See Also

DXSetResolution, DXGetCameraResolution, DXSetView, DXGetView, DXNewCamera, DXSetOrthographic, DXGetOrthographic, DXSetPerspective, DXGetPerspective, DXRender

16.7 , "Camera Class".


[ Top of Page | Previous Page | Next Page | Table of Contents | Partial Table of Contents | Index ]
[Data Explorer Documentation | QuickStart Guide | User's Guide | User's Reference | Programmer's Reference | Installation and Configuration Guide ]

[Data Explorer Home Page]


[IBM Home Page | Order | Search | Contact IBM | Legal ]