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

Flipping an Object

The process of flipping an object works the exact same way as resizing or scaling, with the exception that you use negative numbers as your x, y, or z values. In fact, you can resize, reshape, and flip your objects all at the same time. Just decide along which axis you’d like to reshape and resize your object, and then change the value to a negative number to flip the object. Here’s an example of the code you would use to flip your cone along the z axis (see Figure 5.15).

Figure 5.15. We flipped this cone on the z axis by using the command ScaleEntity cone, 1,1,-1.

cone = CreateCone() PositionEntity cone,0,0,5 ScaleEntity ...

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