EntityShininess.htm 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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>EntityShininess Entity, Shininess#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. Entity - entity handle <br />
  13. Shininess# - shininess of entity
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Sets the specular shininess of an entity. <br />
  22. <br />
  23. The shininess# value should be a floting point number in the range 0-1. The default shininess setting is 0. <br />
  24. <br />
  25. Shininess is how much brighter certain areas of an object will appear to be when a light is shone directly at them. <br />
  26. <br />
  27. Setting a shininess value of 1 for a medium to high poly sphere, combined with the creation of a light shining in the direction of it, will give it the appearance of a shiny snooker ball.
  28. </td>
  29. </tr>
  30. </table>
  31. <h1><a href=../3d_examples/EntityShininess.bb>Example</a></h1>
  32. <table>
  33. <tr>
  34. <td>
  35. ; EntityShininess Example <br />
  36. ; ----------------------- <br />
  37. <br />
  38. Graphics3D 640,480 <br />
  39. SetBuffer BackBuffer() <br />
  40. camera=CreateCamera() <br />
  41. ; Set ambient light to a low level, to increase effect of shininess <br />
  42. <br />
  43. AmbientLight 32,32,32 <br />
  44. light=CreateLight() <br />
  45. RotateEntity light,45,45,0 <br />
  46. <br />
  47. sphere=CreateSphere(100) <br />
  48. EntityColor Sphere,255,0,0 <br />
  49. PositionEntity sphere,0,0,4 <br />
  50. <br />
  51. ; Set initial shine value <br />
  52. <br />
  53. shine#=0 <br />
  54. <br />
  55. While Not KeyDown(1) <br />
  56. ; Change shine value depending on key pressed <br />
  57. <br />
  58. If KeyDown(2)=True And shine#>0 Then shine#=shine#-0.01 <br />
  59. If KeyDown(3)=True And shine#<1 Then shine#=shine#+0.01 <br />
  60. <br />
  61. ; Set entity shininess using shine value <br />
  62. EntityShininess sphere,shine# <br />
  63. <br />
  64. RenderWorld <br />
  65. <br />
  66. Text 0,0,"Press keys 1-2 to change EntityShininess Setting" <br />
  67. Text 0,20,"Entity Shininess: "+shine# <br />
  68. <br />
  69. Flip <br />
  70. Wend <br />
  71. End
  72. </td>
  73. </tr>
  74. </table>
  75. <br>
  76. <a target=_top href=../index.htm>Index</a><br>
  77. <br>
  78. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=EntityShininess&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  79. </html>