O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Splitting Views

Another option you have when working with cameras is to use a split screen. When you have more than one camera, you can split the screen in two so that you can see the view from both cameras at once. To split the screen, you use the

CameraViewport command. Start by entering the following code or by opening demo07-04.bb to create a program with two cameras:

; Lighting and Cameras ; ––––––––––––––––—— Graphics3D 640,480 SetBuffer BackBuffer() ; Create camera camera1=CreateCamera() PositionEntity camera1,0,5,5 RotateEntity camera1,90,0,0 camera2=CreateCamera() PositionEntity camera2,0,0,0 ; Creating a light light=CreateLight() ; This is the code for creating the cylinder cylinder=CreateCylinder() PositionEntity cylinder,0,0,5 ; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required