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

Scaling Textures

After you’ve applied your texture, you may find that it is either too big or too small for the object you are wrapping it around. You can use the ScaleTexture command to increase or decrease the scale of the texture.

Here is the line we would add to our code to scale the texture:

; Creating the texture
tex=LoadTexture( "texture.bmp" )
ScaleTexture tex, 2,2
EntityTexture sphere,tex

After the ScaleTexture command, you tell Blitz3D which texture you want to scale—in this case it is the one called tex. You then specify how much you would like to scale the object. Because the image you used as your texture was two-dimensional, you only have to enter a number for the amount you want to scale the x and y axes. Any numbers you enter ...

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