CameraFogRange.htm 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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>CameraFogRange camera,near#,far#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. camera - camera handle <br />
  13. near# - distance in front of camera that fog starts <br />
  14. far# - distance in front of camera that fog ends
  15. </td>
  16. </tr>
  17. </table>
  18. <h1>Description</h1>
  19. <table>
  20. <tr>
  21. <td>
  22. Sets camera fog range. <br />
  23. <br />
  24. The near parameter specifies at what distance in front of the camera that the fogging effect will start; all 3D object before this point will not be faded. <br />
  25. <br />
  26. The far parameter specifies at what distance in front of the camera that the fogging effect will end; all 3D objects beyond this point will be completely faded out.
  27. </td>
  28. </tr>
  29. </table>
  30. <h1><a href=../3d_examples/CameraFogRange.bb>Example</a></h1>
  31. <table>
  32. <tr>
  33. <td>
  34. ; CameraFogRange Example <br />
  35. ; ---------------------- <br />
  36. <br />
  37. Graphics3D 640,480 <br />
  38. SetBuffer BackBuffer() <br />
  39. <br />
  40. camera=CreateCamera() <br />
  41. PositionEntity camera,0,1,0 <br />
  42. <br />
  43. light=CreateLight() <br />
  44. RotateEntity light,90,0,0 <br />
  45. <br />
  46. plane=CreatePlane() <br />
  47. grass_tex=LoadTexture( "media/mossyground.bmp" ) <br />
  48. EntityTexture plane,grass_tex <br />
  49. <br />
  50. ; Set camera fog to 1 (linear fog) <br />
  51. CameraFogMode camera,1 <br />
  52. <br />
  53. ; Set intial fog range value <br />
  54. fog_range=10 <br />
  55. <br />
  56. While Not KeyDown( 1 ) <br />
  57. <br />
  58. ; If square brackets keys pressed then change fog range value <br />
  59. If KeyDown( 26 )=True Then fog_range=fog_range-1 <br />
  60. If KeyDown( 27 )=True Then fog_range=fog_range+1 <br />
  61. <br />
  62. ; Set camera fog range <br />
  63. CameraFogRange camera,1,fog_range <br />
  64. <br />
  65. If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0 <br />
  66. If KeyDown( 203 )=True Then TurnEntity camera,0,1,0 <br />
  67. If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05 <br />
  68. If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05 <br />
  69. <br />
  70. RenderWorld <br />
  71. <br />
  72. Text 0,0,"Use cursor keys to move about the infinite plane" <br />
  73. Text 0,20,"Press [ or ] to change CameraFogRange value" <br />
  74. Text 0,40,"CameraFogRange camera,1,"+fog_range <br />
  75. <br />
  76. Flip <br />
  77. <br />
  78. Wend <br />
  79. <br />
  80. End
  81. </td>
  82. </tr>
  83. </table>
  84. <br>
  85. <a target=_top href=../index.htm>Index</a><br>
  86. <br>
  87. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CameraFogRange&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  88. </html>