Vizard 7 » Tutorials & Examples » Vizconnect » Inputs and Transports » Tutorial: Transport Commands

Tutorial: Vizconnect Transport Commands

In this section we'll learn how to toggle the transport on and off and change its speed using transport commands.

Note: This section continues with the configuration and script used in the previous section.

Transport Speed

We can use the transport.setMovementSpeed command to scale the transport movement by any given factor. Add the following code and run the script again. Use the F5 - F8 keys to change speed:

#Change transport speed with key presses

Transport Toggle

The way the simulation is currently set up, the user can drive the car from any location in the environment. To make it more realistic, the script can be modified so the transport is only enabled when the user is inside the car. To do this we'll use the vizproximity library to detect viewpoint movements in and out of the car's bounding box area. Once a change is detected the transport.setEnabled command will be called and passed a parameter that turns it on or off. Don't worry about all the details of the proximity code below, that will be covered in later tutorials. For now, just notice how the transport state is set in the EnterProximity and ExitProximity callback functions.


Add the following code and run the script. Now, the transport only moves when the viewpoint is inside the car's bounding box area. Use the 'p' key to toggle the box's visibility:

import vizproximity

manager = vizproximity.Manager()

#Add tracker as proximity target
target = vizproximity.Target(viz.MainView)

#Create sensor using mini
sensor = vizproximity.addBoundingBoxSensor(mini)

#Enable the transport when the user is in the car
def EnterProximity(e):

#Disable the transport when user leaves the car
def ExitProximity(e):


Input and Transport Basics

Transport and Tracker Integration

Transport Commands