O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

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

Creating New Cameras

DB provides a default camera (0) that is set slightly back (in the Z axis) and focused on 0,0,0. You will almost always need to move the default camera out a certain distance, depending on the size of the objects in your scene in order to see those objects. If you are writing a game like a third-person shooter, you will probably want to set the camera just above and behind the main object in the game. You can use the default camera or create additional cameras using the MAKE CAMERA command. The syntax is MAKE CAMERA Camera Number.

After having created a new camera, you can position and point it to a new location in the scene, and then easily switch from one camera to another by simply calling the SET CURRENT CAMERA command, ...

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