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

Zooming

Rather than having to move a camera to get closer or farther away from an object, you can take advantage of Blitz3D’s camera zooming capabilities. In this exercise, we’ll create a sphere that seems far off in the distance and then give the player the ability to zoom in and out using the CameraZoom command.

Start by creating a program that contains only a simple sphere, as designated by the following code. Alternatively, if you want to save a little time typing, open the program called demo07-06.bb.

;demo07-06.bb - Camera zooming ; –––––––––––––––– Graphics3D 640,480 SetBuffer BackBuffer() Const ESC_KEY = 1 Const UP_KEY = 200 Const DOWN_KEY = 208 ; Create camera camera=CreateCamera() zoom# = 1 ; Create a light light=CreateLight() ; This ...

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