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

Resizing or Scaling

To resize a shape, you use the ScaleEntity command and use the same number for the x, y, and z values. For this exercise, we are going to use the “cone” file that you saved earlier, so go ahead and open it. If, for some reason, you didn’t save the file or you skipped the earlier section on creating a cone, you can find the file on the accompanying CD.

Let’s say we want to double the size of the cone we created. To do this we’d add the ScaleEntity command as follows:

; This is the code for creating the cone
cone = CreateCone()
PositionEntity cone,0,0,5
ScaleEntity cone, 2,2,2

Notice that the only line we added to double the size of our cone was the Scale-Entity cone, 2,2,2 command. ScaleEntity tells Blitz3D that there is an ...

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