Commands to change the current model’s view.


axisRotateView

Syntax:

void axisRotateView ( double ax, double ay, double az, double angle )

Rotate the current view angle degrees about an axis defined between the supplied point {ax,ay,az} and the origin.


getView

Syntax:

void getView ( )

Outputs the rotation matrix elements and position vector of the camera for the current model. The list of numbers may be passed directly to the setView command to re-create the view exactly.

For example:

getView();

orthographic

Syntax:

void orthographic ( )

Set the view for all models to be an orthographic projection.

For example:

orthographic();

perspective

Syntax:

void perspective ( )

Set the view for all models to be a perspective projection.

For example:

perspective();

resetView

Syntax:

void resetView ( )

Resets the view rotation and zoom for the current model.

For example:

resetView();

rotateView

Syntax:

void rotateView ( double rotx, double roty )

Rotates the current view by rotx degrees around the x axis and roty degrees around the y axis.

For example:

rotateView(10.0, 0.0);

setView

Syntax:

void setView ( double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz, double x, double y, double z )

Sets the rotation matrix and position vector of the camera for the current model. The output of getView can be passed to setView to recreate an existing camera rotation and position.

For example:

setView(1, 0, 0 ,0, 0, 1, 0, -1, 0, 0.0, 0.0, -10.0);

sets a view with the z axis pointing up, and the y axis normal to the screen (i.e. rotated 90 degrees around the x axis)


speedTest

Syntax:

void speedTest ( int nRenders = 100 )

Performs a quick speed test based on rendering of the current model and general view.

For example:

speedTest();

spins the current model for the default of 100 rendering passes.

speedTest(2000);

spins the current model for 2000 rendering passes.


translateView

Syntax:

void translateView ( double x, double y, double z )

Translates the camera viewing the current model.

For example:

translateView(0.0, 0.0, 1.0);

viewAlong

Syntax:

void viewAlong ( double x, double y, double z )

Sets the current view so that it is along the specified vector.

For example:

viewAlong(0, 0, -1);

view the current model along the negative z-axis.


viewAlongCell

Syntax:

void viewAlongCell ( double x, double y, double z )

Sets the current view so that is along the specified cell vector.

For example:

viewAlongCell(1, 0, 0);

view the current model along the cell’s x axis.


zoomView

Syntax:

void zoomView ( double dz )

Zooms the view by the specified amount.

For example:

zoomView(10.0);

moves the camera 10 Å forwards along the z-direction.

zoomView(-5);

moves the camera 5 Å backwards along the z-direction.