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

Going Inside Shapes

What if you want to have a game inside of a room? You will have to go INSIDE of a shape to do so! The process of creating a shape to use as your 3D world isn’t very difficult. You simply have to create a large version of the desired shape and then add a few commands to make things work. There are three new commands that we’ll use in this section of code: FitMesh, FlipMesh, and EntityFX. I’ll discuss each of these after we’ve entered the code.

Let’s create a program that allows us to go inside shapes! Demo09-05.bb shows how it’s done. Make sure that the file called wall.jpg is also placed in the same directory as demo09-05.bb.

;demo09-05.bb - Going inside a shape ; –––––––––––––––– Graphics3D 640,480 SetBuffer BackBuffer() ...

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