Working with Cameras

The camera acts as the eyes for the player of the game. Where you place the camera or cameras will directly determine the action that the player sees. Blitz3D makes it easy to manipulate the location, angle, and zoom level of our cameras. Most of the camera settings we will apply in this chapter will be performed on a simple cylinder. Before continuing, either open the program called demo07-01.bb or enter the following code:

; Lighting and Cameras
; ––––––––––––––––——
Graphics3D 640,480
SetBuffer BackBuffer()
; Create camera
camera=CreateCamera()
; Creating a light
light=CreateLight()
; This is the code for creating the cylinder
cylinder=CreateCylinder()
PositionEntity cylinder,0,0,5
EntityColor cylinder, 0,26,125
; The following code makes our program run
While Not KeyDown(1)
RenderWorld
Flip
Wend
End

When you run this program, you should see a cylinder (see Figure 7.1).

Figure 7.1. The demo07-01.bb program.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.34.253