Vizard 7 » Tutorials & Examples » Viewpoints & windows » Windows & views » Tutorial: Adding a rear view window
7.6

Tutorial: Adding a rear view window

Now we will add another subwindow and viewpoint which will show a rear view of the scene. The code is similar to creating the birds-eye-view:

RearWindow = viz.addWindow()
RearWindow.fov(60)
RearView = viz.addView()
RearWindow.setView(RearView)

If you run the script you will notice that the new subwindow is on top of the birds-eye-view window. The following code will move the new subwindow to the upper-left corner of the screen:

RearWindow.setPosition([0,1])

This tells vizard that the subwindows upper left corner should be placed at screen coordinates (0,1). Remember that screen coordinates range from 0 to 1 where (0,0) is the bottom-left corner of the screen and (1,1) is the upper-right corner of the screen.

 

Now we need to have the rear view point behind the main view. To do this we need to create a link between the MainView and the RearView.

#Make RearView look behind MainView
viewLink = viz.link( viz.MainView, RearView )
viewLink.preEuler([180, 0, 0]) #spin view backwards

Now run your script and the rear view should always be pointing behind the main view.

Windows and viewpoints come in handy when you want to see your scene from multiple angles at the same time.

Adding a bird's eye view

Adding a rear view window