| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>CameraFogRange camera,near#,far#</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- camera - camera handle
<br />
- near# - distance in front of camera that fog starts
<br />
- far# - distance in front of camera that fog ends
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Sets camera fog range.
<br />
-
<br />
- 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 />
-
<br />
- 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.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/CameraFogRange.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; CameraFogRange Example
<br />
- ; ----------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
- PositionEntity camera,0,1,0
<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 />
- ; Set camera fog to 1 (linear fog)
<br />
- CameraFogMode camera,1
<br />
-
<br />
- ; Set intial fog range value
<br />
- fog_range=10
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- ; If square brackets keys pressed then change fog range value
<br />
- If KeyDown( 26 )=True Then fog_range=fog_range-1
<br />
- If KeyDown( 27 )=True Then fog_range=fog_range+1
<br />
-
<br />
- ; Set camera fog range
<br />
- CameraFogRange camera,1,fog_range
<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 [ or ] to change CameraFogRange value"
<br />
- Text 0,40,"CameraFogRange camera,1,"+fog_range
<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=CameraFogRange&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|