| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>CameraFogMode camera,mode</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- camera - camera handle
<br />
- <br />
- mode -
<br />
- 0: no fog (default)
<br />
- 1: linear fog
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Sets the camera fog mode.
<br />
-
<br />
- This will enable/disable fogging, a technique used to gradually fade out graphics the further they are away from the camera. This can be used to avoid 'pop-up', the moment at which 3D objects suddenly appear on the horizon.
<br />
-
<br />
- The default fog colour is black and the default fog range is 1-1000, although these can be changed by using CameraFogColor and CameraFogRange respectively.
<br />
-
<br />
- Each camera can have its own fog mode, for multiple on-screen fog effects.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/CameraFogMode.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; CameraFogMode Example
<br />
- ; ---------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
- PositionEntity camera,0,1,0
<br />
- CameraFogRange camera,1,10
<br />
-
<br />
- light=CreateLight()
<br />
- RotateEntity light,90,0,0
<br />
-
<br />
- plane=CreatePlane()
<br />
- grass_tex=LoadTexture( "media/mossyground.bmp" )
<br />
- EntityTexture plane,grass_tex
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- ; Toggle camera fog mode between 0 and 1 when spacebar is pressed
<br />
- If KeyHit( 57 )=True Then fog_mode=1-fog_mode : CameraFogMode camera,fog_mode
<br />
-
<br />
- If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
<br />
- If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
<br />
- If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
<br />
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor keys to move about the infinite plane"
<br />
- Text 0,20,"Press spacebar to toggle between CameraFogMode 0/1"
<br />
- If fog_mode=False Then Text 0,40,"CameraFogMode 0" Else Text 0,40,"CameraFogMode 1"
<br />
-
<br />
- Flip
<br />
-
<br />
- Wend
<br />
-
<br />
- End
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CameraFogMode&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|