RotateTexture.htm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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>RotateTexture texture,angle#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. texture - texture handle <br />
  13. angle# - absolute angle of texture rotation
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Rotates a texture. <br />
  22. <br />
  23. This will have an immediate effect on all instances of the texture being used. <br />
  24. <br />
  25. Rotating a texture is useful for performing swirling texture effects, such as for smoke etc.
  26. </td>
  27. </tr>
  28. </table>
  29. <h1><a href=../3d_examples/RotateTexture.bb>Example</a></h1>
  30. <table>
  31. <tr>
  32. <td>
  33. ; RotateTexture Example <br />
  34. ; --------------------- <br />
  35. <br />
  36. Graphics3D 640,480 <br />
  37. SetBuffer BackBuffer() <br />
  38. <br />
  39. camera=CreateCamera() <br />
  40. <br />
  41. light=CreateLight() <br />
  42. RotateEntity light,90,0,0 <br />
  43. <br />
  44. cube=CreateCube() <br />
  45. PositionEntity cube,0,0,5 <br />
  46. <br />
  47. ; Load texture <br />
  48. tex=LoadTexture( "media/b3dlogo.jpg" ) <br />
  49. <br />
  50. ; Texture cube <br />
  51. EntityTexture cube,tex <br />
  52. <br />
  53. ; Set initial texture angle value <br />
  54. angle#=1 <br />
  55. <br />
  56. While Not KeyDown( 1 ) <br />
  57. <br />
  58. ; Change texture angle value depending on key pressed <br />
  59. If KeyDown( 205 )=True Then angle#=angle#-1 <br />
  60. If KeyDown( 203 )=True Then angle#=angle#+1 <br />
  61. <br />
  62. ; Rotate texture <br />
  63. RotateTexture tex,angle# <br />
  64. <br />
  65. TurnEntity cube,0.1,0.1,0.1 <br />
  66. <br />
  67. RenderWorld <br />
  68. <br />
  69. Text 0,0,"Use left and right cursor keys to change texture angle value" <br />
  70. Text 0,20,"angle#="+angle# <br />
  71. <br />
  72. Flip <br />
  73. <br />
  74. Wend <br />
  75. <br />
  76. End
  77. </td>
  78. </tr>
  79. </table>
  80. <br>
  81. <a target=_top href=../index.htm>Index</a><br>
  82. <br>
  83. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=RotateTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  84. </html>