EntityTexture.htm 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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>EntityTexture entity,texture[,frame][,index]</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. entity - entity handle <br />
  13. texture - texture handle <br />
  14. frame (optional) - frame of texture. Defaults to 0. <br />
  15. index (optional) - index number of texture. Should be in the range to 0-7. Defaults to 0.
  16. </td>
  17. </tr>
  18. </table>
  19. <h1>Description</h1>
  20. <table>
  21. <tr>
  22. <td>
  23. Applies a texture to an entity. <br />
  24. <br />
  25. The optional frame parameter specifies which texture animation frame should be used as the texture. <br />
  26. <br />
  27. The optional index parameter specifies which index number should be assigned to the texture. Index numbers are used for the purpose of multitexturing. See TextureBlend. <br />
  28. <br />
  29. A little note about multitexturing and slowdown. Graphics cards support a maximum amount of textures per object, which can be used with very little, if any, slowdown. For most cards this is two, but for a GeForce3 it is four. However, once you use more than this amount, Blitz will emulate the effect itself by duplicating objects and textures. Obviously, this may then cause slowdown.
  30. </td>
  31. </tr>
  32. </table>
  33. <h1><a href=../3d_examples/EntityTexture.bb>Example</a></h1>
  34. <table>
  35. <tr>
  36. <td>
  37. ; EntityTexture Example <br />
  38. ; --------------------- <br />
  39. <br />
  40. Graphics3D 640,480 <br />
  41. SetBuffer BackBuffer() <br />
  42. <br />
  43. camera=CreateCamera() <br />
  44. <br />
  45. light=CreateLight() <br />
  46. RotateEntity light,90,0,0 <br />
  47. <br />
  48. cube=CreateCube() <br />
  49. PositionEntity cube,0,0,5 <br />
  50. <br />
  51. ; Load texture <br />
  52. tex=LoadTexture( "media/b3dlogo.jpg" ) <br />
  53. <br />
  54. ; Texture entity <br />
  55. EntityTexture cube,tex <br />
  56. <br />
  57. While Not KeyDown( 1 ) <br />
  58. <br />
  59. pitch#=0 <br />
  60. yaw#=0 <br />
  61. roll#=0 <br />
  62. <br />
  63. If KeyDown( 208 )=True Then pitch#=-1 <br />
  64. If KeyDown( 200 )=True Then pitch#=1 <br />
  65. If KeyDown( 203 )=True Then yaw#=-1 <br />
  66. If KeyDown( 205 )=True Then yaw#=1 <br />
  67. If KeyDown( 45 )=True Then roll#=-1 <br />
  68. If KeyDown( 44 )=True Then roll#=1 <br />
  69. <br />
  70. TurnEntity cube,pitch#,yaw#,roll# <br />
  71. <br />
  72. RenderWorld <br />
  73. Flip <br />
  74. <br />
  75. Wend <br />
  76. <br />
  77. End
  78. </td>
  79. </tr>
  80. </table>
  81. <br>
  82. <a target=_top href=../index.htm>Index</a><br>
  83. <br>
  84. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=EntityTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  85. </html>