Vizard 7 » Reference » Stereo & Displays » Display devices » zSpace
7.6

zSpace

The zspace module adds support for the zSpace line of 3D interactive displays. A full sample script can be found at \examples\devices\zspaceExample.py.

Note: The zSpace display uses quad buffering for rendering in stereo, which means you will need a quad buffer supported graphics card (e.g. nVidia Quadro)

The zspace module contains the following functions/constants:

Function

Description

zspace.init()

This is a helper function that sets the fullscreen monitor to the zSpace monitor number and initializes the Vizard graphics window in fullscreen, quad-buffered mode. It will return the global zspace.Display object. See below for more details.

zspace.getDisplay()

Returns the global zspace.Display object. See below for more details.

zspace.getMonitorNumber(default=0)

Detects and returns the monitor number associated with the zSpace display. If the display could not be detected, then the default value is returned.

zspace.getHeadTracker()

Returns the zspace head tracker sensor. The tracker provides position and orientation data, relative to the center of the display.

zspace.getWandTracker()

Returns the zspace wand tracker sensor. The tracker provides position and orientation data, relative to the center of the display. The wand tracker also provides button data.

zspace.getExtension() Returns the underlying zspace extension object. See below for more details.
zspace.addWall() Creates and returns a vizcave.Wall object corresponding to the zSpace display. The zspace.Display object automatically sets up the cave and wall settings. This method is only needed if you would like to manually setup the cave.
zspace.TAP_PRESS_EVENT

Event triggered when wand tap on display begins. Provides a single event structure e with the following attributes:

  • e.object: Tracker object that triggered the event
  • e.pos.pixels: 2D [x,y] pixel window coordinates where tap event occurred
  • e.pos.normalized: 2D [x,y] normalized window coordinates where tap event occurred
  • e.pos.screen: 2D [x,y] pixel desktop screen coordinates where tap event occurred
zspace.TAP_RELEASE_EVENT Event triggered when wand tap on display is released. Provides a single event structure e with the attributes described in zspace.TAP_PRESS_EVENT above.
zspace.TAP_SINGLE_EVENT Event triggered when a single wand tap on display occurs. Provides a single event structure e with the attributes described in zspace.TAP_PRESS_EVENT above.
zspace.TAP_DOUBLE_EVENT Event triggered when a double wand tap on display occurs. Provides a single event structure e with the attributes described in zspace.TAP_PRESS_EVENT above.
zspace.TAP_HOLD_EVENT Event triggered when wand tap is held on display for a delayed amount of time. Tap delay can be configured with wand tracker object (see below). Provides a single event structure e with the attributes described in zspace.TAP_PRESS_EVENT above.
zspace.waitTapPress(tracker) viztask.Condition object that waits for a zspace.TAP_PRESS_EVENT. The condition will yield the event structure provided by the event.
zspace.waitTapRelease(tracker) viztask.Condition object that waits for a zspace.TAP_RELEASE_EVENT. The condition will yield the event structure provided by the event.
zspace.waitTapSingle(tracker) viztask.Condition object that waits for a zspace.TAP_SINGLE_EVENT. The condition will yield the event structure provided by the event.
zspace.waitTapDouble(tracker) viztask.Condition object that waits for a zspace.TAP_DOUBLE_EVENT. The condition will yield the event structure provided by the event.
zspace.waitTapHold(tracker) viztask.Condition object that waits for a zspace.TAP_HOLD_EVENT. The condition will yield the event structure provided by the event.

The zspace.Display object contains the following methods:

Method

Description

<display>.getRoot()

Returns the root node for navigating the zspace viewer through the virtual world.

<display>.getWandRoot()

Returns the root node for the wand. This can be used to query the position/orientation of the wand within the virtual world and to attach objects to the wand.

<display>.getWandLine(distance=500)

Returns a viz.Line object corresponding to the position and direction the wand is pointing in the virtual world. The line ends at the specified distance from the wand position.

<display>.setIPD(ipd) Set the display IPD value
<display>.getIPD() Get the display IPD value

<display>.setScale(scale)

Set the display scale factor. When viewing large models that would not otherwise fit within the physical dimensions of the display, you can set a large scale factor to avoid having to scale down all the models in the virtual world. The default scale factor is 1.

<display>.getScale()

Get the display scale factor.

<display>getTrackerSpaceRoot() Returns the root node for displaying objects in the physical tracker space.
<display>.getHUD() Returns the root HUD node for the display, which can be used to add objects fixed to the display surface.
<display>.addMessagePanel(message, pos=(0,0,0)) Creates a vizdlg.Panel for displaying a message to the user. The panel is placed at the display surface by default.
<display>.getCave() Returns the underlying vizcave.Cave object used to setup the display.

<display>.remove()

Remove the display object and resources.

The zspace extension object contains the following methods:

Method

Description

<zspace>.addHeadTracker()

Get the zSpace head tracker sensor.

<zspace>.addWandTracker()

Get the zSpace wand tracker sensor.

<zspace>.getDisplayPosition()

Get the [x,y,z] center position of the zSpace display.

<zspace>.getDisplaySize()

Get the [width,height] of the zSpace display in meters.

<zspace>.getDisplayEuler()

Get the euler rotation of the zSpace display.

<zspace>.getDisplayPlane() Get the viz.Plane object representing the zSpace display surface.

The zspace wand and head tracker objects provide the following methods in addition to the standard extension sensor methods:

Method

Description

<tracker>.trackerToWindow(pos=None)

Converts the 3D tracker position to 2D window coordinates by projecting the 3D point directly onto the display surface. If pos is None, then the current tracker position will be used. Returns a data object with the following attributes:

  • pixels: 2D [x,y] pixel window coordinates
  • normalized: 2D [x,y] normalized window coordinates
  • screen: 2D [x,y] pixel desktop screen coordinates

<tracker>.intersectDisplay(line=None)

Intersects the line with the zSpace display surface. if line is None, then the current tracker forward line is used. The begin/end values of the line should be in the zSpace tracker coordinate system. Returns a data object with the following attributes:

  • valid: True/False value representing whether the line intersected within the physical display boundaries
  • pos: 3D intersection position on display surface, in the zSpace tracker coordinate system. The position may be outside the physical display boundaries. You can use the valid attribute to check for this.

The zspace wand tracker objects provide the following additional methods:

Method

Description

<wand>.setLedEnabled(mode)

Set whether the LED light on the wand is enabled. mode can be True, False, or viz.TOGGLE.

<wand>.getLedEnabled()

Get whether the LED light on the wand is enabled.

<wand>.setLedColor(color)

Set the LED light RGB color. Each channel only supports a binary 0/1 value. This limits the color to one of the following values:

  • viz.BLACK
  • viz.RED
  • viz.GREEN
  • viz.BLUE
  • viz.YELLOW
  • viz.CYAN
  • viz.MAGENTA
  • viz.WHITE
<wand>.getLedColor() Get the LED light RGB color.

<wand>.setVibrate(mode,

on=1.0,

off=0.0,

repeat=viz.FOREVER)

 

Set wand vibration parameters. mode can be True, False, or viz.TOGGLE. If vibration is enabled, on specifies the duration (in seconds) to vibrate. off specifies the duration (in seconds) to not vibrate. repeat specifies the number of times to repeat the on/off cycle, or viz.FOREVER to repeat indefinitely until the vibration is explicitly disabled.

<wand>.getVibrate() Get whether the wand is vibrating.
<wand>.setTapHoldDelay(delay) Set the delay (in seconds) for triggering the zspace.TAP_HOLD_EVENT.
<wand>.getTapHoldDelay() Get the delay (in seconds) for triggering the zspace.TAP_HOLD_EVENT.

<wand>.setMouseEmulation(mode,

buttons=(0,1,2))

Set the wand mouse emulation parameters, which allows using the wand to move the system mouse and simulate button presses. mode can be True, False, or viz.TOGGLE. If mouse emulation is enabled, then buttons is a list specifying which wand button IDs correspond to the left, right, and middle mouse buttons. When mouse emulation is enabled, tapping on the display with the wand will also simulate the left mouse button.
<wand>.getMouseEmulation() Get whether mouse emulation is enabled.