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 Cubes, Cylinders, and Spheres

There are several other shapes that you can create using Blitz3D, all of which are created in the exact same manner as you created the cone earlier. The only difference is that the create command you use will be different for each shape.

  • CreateSphere()—This will create a sphere.

  • CreateCube()—This will create a cube.

  • CreateCylinder()—This will create a cylinder.

Don’t forget that, when using any of these commands, you’ll need to specify a name for the shape you are creating as well as a location. Here is an example of how you would create a cube within a program.

; This is the code for creating a cube
cube=CreateCube()
PositionEntity cube,0,0,5

Note: Now You Try

Take a look at Figure 5.10. Try to replicate ...

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