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

Reshaping

Reshaping an object works in much the same ways as scaling or resizing in that it uses the ScaleEntity command. The difference this time is that if you want to stretch or squish an object, the number that you enter for the x, y, and z values will be different. Let’s go back and open the saved version of the “cone” file we created earlier to illustrate how we reshape our object. With this code, we will stretch the cone along the y axis.

cone = CreateCone()
PositionEntity cone,0,0,5
ScaleEntity cone, 1,2,1

We entered the numbers 1,2,1 which mean we are going to scale the x axis by multiplying it by 1 (which will result in no change, because any number multiplied by 1 remains the same), multiplying the y axis by 2, which will double the ...

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