Papervision3D includes four types of cameras:
Target camera
Free camera
Debug camera
Spring camera
The target camera and the free camera are the most common types and will be discussed first. The debug camera is handy for testing purposes as it has some basic built-in navigation, and continuously displays information about its settings. A special type is the spring camera that provides an easy way to follow a moving 3D object, something that can be useful in game applications.
You set the camera type of your choice by passing it as an argument to the constructor of the BasicView
class. Because we extend BasicView
, we can use the super()
call in our constructor to do so.
super(stage.stageWidth,stage.stageHeight,true,false, CameraType.TARGET);
In Chapter 2 we have seen what the first three arguments do. And in the previous chapter we added a fourth one to set the interactivity of the viewport. Now we have added a fifth argument, which sets the type of camera you would like to use....