camera - camera handle near# - distance in front of camera that fog starts far# - distance in front of camera that fog ends |
Sets camera fog range. 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. 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. |
; dxCameraFogRange Example ; ---------------------- dxGraphics3D 640,480 dxSetBuffer dxBackBuffer() camera=dxCreateCamera() dxPositionEntity camera,0,1,0 light=dxCreateLight() dxRotateEntity light,90,0,0 plane=dxCreatePlane() grass_tex=dxLoadTexture( "media/mossyground.bmp" ) dxEntityTexture plane,grass_tex ; Set camera fog to 1 (linear fog) dxCameraFogMode camera,1 ; Set intial fog range value fog_range=10 While Not dxKeyDown( 1 ) ; If square brackets keys pressed then change fog range value If dxKeyDown( 26 )=True Then fog_range=fog_range-1 If dxKeyDown( 27 )=True Then fog_range=fog_range+1 ; Set camera fog range dxCameraFogRange camera,1,fog_range If dxKeyDown( 205 )=True Then dxTurnEntity camera,0,-1,0 If dxKeyDown( 203 )=True Then dxTurnEntity camera,0,1,0 If dxKeyDown( 208 )=True Then dxMoveEntity camera,0,0,-0.05 If dxKeyDown( 200 )=True Then dxMoveEntity camera,0,0,0.05 dxRenderWorld dxText 0,0,"Use cursor keys to move about the infinite plane" dxText 0,20,"Press [ or ] to change dxCameraFogRange value" dxText 0,40,"dxCameraFogRange camera,1,"+fog_range dxFlip Wend End |