ScaleTexture.htm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>ScaleTexture texture,u_scale#,v_scale#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. texture - name of texture <br />
  13. u_scale# - u scale <br />
  14. v_scale# - v scale
  15. </td>
  16. </tr>
  17. </table>
  18. <h1>Description</h1>
  19. <table>
  20. <tr>
  21. <td>
  22. Scales a texture by an absolute amount. <br />
  23. <br />
  24. This will have an immediate effect on all instances of the texture being used.
  25. </td>
  26. </tr>
  27. </table>
  28. <h1><a href=../3d_examples/ScaleTexture.bb>Example</a></h1>
  29. <table>
  30. <tr>
  31. <td>
  32. ; ScaleTexture Example <br />
  33. ; -------------------- <br />
  34. <br />
  35. Graphics3D 640,480 <br />
  36. SetBuffer BackBuffer() <br />
  37. <br />
  38. camera=CreateCamera() <br />
  39. <br />
  40. light=CreateLight() <br />
  41. RotateEntity light,90,0,0 <br />
  42. <br />
  43. cube=CreateCube() <br />
  44. PositionEntity cube,0,0,5 <br />
  45. <br />
  46. ; Load texture <br />
  47. tex=LoadTexture( "media/b3dlogo.jpg" ) <br />
  48. <br />
  49. ; Texture cube <br />
  50. EntityTexture cube,tex <br />
  51. <br />
  52. ; Set initial uv scale values <br />
  53. u_scale#=1 <br />
  54. v_scale#=1 <br />
  55. <br />
  56. While Not KeyDown( 1 ) <br />
  57. <br />
  58. ; Change uv scale values depending on key pressed <br />
  59. If KeyDown( 208 )=True Then u_scale#=u_scale#-0.01 <br />
  60. If KeyDown( 200 )=True Then u_scale#=u_scale#+0.01 <br />
  61. If KeyDown( 203 )=True Then v_scale#=v_scale#-0.01 <br />
  62. If KeyDown( 205 )=True Then v_scale#=v_scale#+0.01 <br />
  63. <br />
  64. ; Scale texture <br />
  65. ScaleTexture tex,u_scale#,v_scale# <br />
  66. <br />
  67. TurnEntity cube,0.1,0.1,0.1 <br />
  68. <br />
  69. RenderWorld <br />
  70. <br />
  71. Text 0,0,"Use cursor keys to change uv scale values" <br />
  72. Text 0,20,"u_scale#="+u_scale# <br />
  73. Text 0,40,"v_scale#="+v_scale# <br />
  74. <br />
  75. Flip <br />
  76. <br />
  77. Wend <br />
  78. <br />
  79. End
  80. </td>
  81. </tr>
  82. </table>
  83. <br>
  84. <a target=_top href=../index.htm>Index</a><br>
  85. <br>
  86. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=ScaleTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  87. </html>