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

Creating and Positioning a Camera

You’ve actually created a camera several times already by using the Create-Camera() command. Just like with creating shapes, you need to give your camera a name. Typically when coding a camera you should give the camera a generic name like camera or camera1 to make things easier. For example, if we wanted to create and name a camera called camera1, we would enter the following code:

camera1=CreateCamera()

The next step is to position your camera. Cameras can be positioned like most other objects using the PositionEntity command. You simply need to specify where on the screen you would like the camera to be.

For this example, remove the existing code under ;Create Camera in the demo07-01.bb program and replace ...

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