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

Segments

When you create spheres, cones, and cylinders, you can specify the number of segments that each is made of. A segment controls the number of polygons that are used to make up your shapes. This will control how “smooth” the shape will appear onscreen.

You may have noticed that the command you used for creating your shape was also followed by a series of parentheses. Typically, those parentheses can contain a definition of the number of segments, and they can define a parent. Don’t worry about parents right now, but I will discuss segments. You can specify the number of segments in the brackets. For example, in this instance, the cone would be made of 25 segments:

cone=CreateCone(25)

Take a look at Figure 5.11, which compares a sphere ...

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