Viz: the server

Viz consists of a server, the rendering program, and clients the rest of the application. This document explains how to operate the server.

Using the server
How to use the viewers
How to draw a polyline


Server

Usage: mainViz [OPTION] ...

OPTIONS:
--debug-level=INT
Controls the level of verbosity for debug messages: --input-port-number=INT
Communications server socket port number (socket port to send commands to viz). Default is 50008.

--logfile=NAME
If specified, mainViz generates a logfile.

--iv-timer=INT
Timer interval between queue updates [msec].  Defaults to 20.

--iv-execute=INT
Allowed execution time at each queue update [msec]. Defaults to 10.

--viewers=INT
Number of viewers in the mainViz window (currently only 1 to 3 is supported). Default is 1.

--version
Report mainViz version.

-h, --help
Help message.

The Viz server also uses a set of environment variables. Note that command line arguments will take precedence over the environment variables.
VIZDATA points to a directory in which Viz can create output files.
VIZPATH points to a list of directories (separated by ':') containing models. Viz will look in these directories if the path to these models is not specified when adding the object.
VIZMSGPORT contains the Viz port number  to which clients can connect.
VIZSERVERHOST contains the hostname on which the viz server is running.


How to use the viewers

The main Viz window contains one or several viewers. Each viewer can be in Interactive Mode (arrow cursor) or Viewing Mode (hand cursor). Pressing ESC allows to switch between these modes.
 

Viewing mode

Moving your viewpoint inside the virtual world is done in the Viewing Mode. Dragging the mouse on the viewer moves the viewpoint according to the selected viewer type (see below). A button bar (called "decoration") on the right side of the viewer allows to perform additional operations. Holding the right mouse button in this mode pops up the rendering features menu.

When the viewer is in Interactive Mode, pressing and holding the ALT key temporarily switches the viewer to Viewing Mode. When the ALT
key is released, the viewer returns to Interactive Mode. Note: If any of the mouse buttons are currently depressed, the ALT key has no effect.

Examiner Viewer

This viewer uses a virtual trackball to view the scene. The viewpoint is allowed to view the scene from any position and orientation.

Left Mouse: Rotate the virtual trackball.
Middle Mouse or  Ctrl + Left Mouse: Translate up, down, left, right.
Ctrl + Middle Mouse or  Left + Middle Mouse: Dolly in and out (gets closer to and further away from the object).
<s> + Left Mouse: Alternative to the Seek button. Press (but do not hold down) the <s> key, then click on a target object.

Fly Viewer

This viewer allows to fly through space, with a constant world up direction.

Left Mouse: Click to increase speed.
<s> + Left Mouse: Alternative to the Seek button. Press (but do not hold down) the <s> key, then click on a target object.
<u> + Left Mouse: Press (but do not hold down) the <u> key, then click on a target object to set the "up" direction to the surface normal. By default +y is the "up" direction.
Middle Mouse: Click to decrease speed.
Left and Middle Mouse: Click both simultaneously to stop.
Ctrl: Hold the key down to temporarily stop and rotate the viewpoint.

Walk Viewer

This viewer moves the camera on a plane.

Left Mouse: Walk mode. Click down and move up and down for fowards and backwards motion. Move right and left for turning. Speed increases
exponentially with the distance from the mouse-down origin.
Middle Mouse or Ctrl + Left Mouse: Translate up, down, left, and right.
Ctrl + Middle Mouse: Tilt the camera up/down and right/left. This allows you to look around while stopped.
<s> + Left Mouse: Alternative to the Seek button. Press (but do not hold down) the <s> key, then click on a target object.
<u> + Left Mouse: Press (but do not hold down) the <u> key, then click on a target object to set the "up" direction to the surface normal. By default +y is the "up" direction.

Plane Viewer

This viewer keeps the camera on a plane, and tilting is disabled.

Left Mouse or Left + Middle Mouse: Dolly in and out (gets closer to and further away from the object).
Middle Mouse or Ctrl + Left Mouse: Translate up, down, left and right.
Ctrl + Middle Mouse: Used for roll action (rotates around the viewer forward direction).
<s> + Left Mouse: Alternative to the Seek button. Press (but do not hold down) the <s> key, then click on a target object.

Flyaround Viewer

This viewer uses a virtual trackball to inspect the scene while keeping the scene up direction vertical with respect to the camera. It is essentially similar to the Examiner Viewer except that the ground will always look horizontal to the camera.
 

Interactive mode

All viewers have the same selection mode. The selection mode allows the user to interactively with the mouse:

Key mapping:

'H':    Help. Display Viz help if netscape is running.
'L':    Add directional light editor
'M':    Read mail
'N':    Read usenet news
'P':    Print scene graph to standard output
'-':    Decrement debug level
'=':    Increment debug level
 

 Drawing a polyline:

In order to help you define lists of points in the 3D environment (such as defining an area, or waypoints, ...), Viz manages a polyline that youcan modify and that clients can query.

Using the setPolyline message, you can set the maximum number of points (can be unlimited), and whether it's an open or closed polyline.
Drawing a polyline is done by clicking with the left button to define the tie points of the polyline. A cursor that follows the models will show the current 3D location of the point.

If the maximum number of points is reached and the polyline is set to be closed, then no more points can be added and a line connecting the last point to the first points is drawn: the polyline is closed. You can close the polyline at any time by pressing the middle button. You can finish the polyline by setting the last point location.

If the polyline is set to be open, you can finish the polyline at any time by pressing the middle button.

When a polyline is finished, no more points can be added or set, unless you reset the polyline. Viz then sends an output message 'polyline'.

Useful keys:
'1':    Switch to open polyline mode and reset
'BACKSPACE': remove last point from polylines