Vizard 7 » Reference » Viewpoints & Windows » Windows » Window basics
7.5

Window basics

When you run a Vizard script, you automatically create the main window. This window can have a number of different sub-windows. Windows have various parameters which determine the world's rendering. A window can be linked to one view, or it can toggle back and forth between a number of different viewpoints. Each window also has a set of properties (included in the <window> library) which determine what portions of the world are rendered by that window including stereo parameters, clipping planes, the frustrum matrix, and the field of view.

 

The application window or graphics window is the display window in which the Vizard windows are displayed. This kind of window has its own set of features and parameters. Check out the application window section to learn more.

Grabbing the main window

To grab the main window, use viz.MainWindow. Use commands from the <window> class to manipulate the main window.

#Change the color of the main window.
viz.MainWindow.clearcolor( viz.RED )

Creating and setting parameters for sub-windows

The <window> class of commands allow you to set properties of the main window and sub windows.To create new subwindows, use viz.addWindow(). To move a sub-window within the main window, use <window>.setPosition(<x,y>)where <x,y> are the coordinates within the main window where you want the upper lefthand corner or your subwindow to lie. The main window's coordinates are proportional to its size, going from (0,0) in the bottom lefthand corner out to 1 in either direction. Use window.setScale( <x,y> ) to change the size of a subwindow. Here <x,y> are proportions of the width and length of the main window with the subwindow scaling from its upper lefthand corner.

#Add a sub-window.
subWindow = viz.addWindow()
#Position the sub-window.
subWindow.setPosition( .5,.5 )

Main window and sub-window properties

The <window> class of commands also lets you get parameters for a given window such as the frustum of the window's projection matrix, the aspect ratio of the window, the window's field of view, etc. Check out the section on stereo for details on how to change a window's stereo effects.

See also

In this section:

Picking objects off the screen

Screen and world coordinates

Window command table

Other sections:

Viewpoint and window basics

Viewpoint basics

Stereo basics

Application window basics

Tutorial: Windows & views

Example scripts:

Window views