View Commands

View Commands

Commands to change the current model's view.

axisrotateview

Syntax:

void axisrotateview(ax,  
 ay,  
 az,  
 angle); 
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 3x3 rotation matrix, the camera position vector, and the z-rotation of the camera for the current model's view. 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(rotx,  
 roty); 
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(ax,  
 ay,  
 az,  
 bx,  
 by,  
 bz,  
 cx,  
 cy,  
 cz,  
 x,  
 y,  
 z); 
double  ax;
double  ay;
double  az;
double  bx;
double  by;
double  bz;
double  cx;
double  cy;
double  cz;
double  x;
double  y;
double  z;
void setview(ax,  
 ay,  
 az,  
 bx,  
 by,  
 bz,  
 cx,  
 cy,  
 cz,  
 x,  
 y,  
 z,  
 zrot); 
double  ax;
double  ay;
double  az;
double  bx;
double  by;
double  bz;
double  cx;
double  cy;
double  cz;
double  x;
double  y;
double  z;
double  zrot;

Sets the current view to the rotation matrix, camera vector, and (if supplied) camera rotation (''zrot'') specified. The 10-number output of getview can be passed to 'setview' to recreate the old 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(nrenders = 100); 
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(x,  
 y,  
 z); 
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(x,  
 y,  
 z); 
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(x,  
 y,  
 z); 
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(dz); 
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.