Creating a Plane

One of the easiest ways to make a “playing field” for your game is to create a plane. A plane is an endless surface that continues on and on into infinity. The biggest advantage of a plane is that it goes on forever, so there is no chance that your players will fall off the edge of the playing surface. This is a great alternative to creating a terrain.

Creating a plane is quite simple; it can be made as easily as any shape. Planes act much like shapes in that they can be colored or textured. In the following example, we’ll add a plane to an empty program.

Start by entering the following code into Blitz3D. Once you have entered the code, save it with a new name.

Graphics3D 640,480
SetBuffer BackBuffer()
; Create camera
camera=CreateCamera()
PositionEntity camera,0,1,0; Creating a light
light=CreateLight()
; Creating a plane
myplane=CreatePlane()
; The following code makes our program run
While Not KeyDown( 1 )
RenderWorld
Flip
Wend
End

The name of the plane we created in this example is “myplane,” but we could have called it anything. The actual code that creates the plane is CreatePlane().

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

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