| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>CameraZoom camera,zoom#</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- camera - camera handle
<br />
- zoom# - zoom factor of camera
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Sets zoom factor for a camera. Defaults to 1.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/CameraZoom.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; CreateZoom 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 />
- ground=CreatePlane()
<br />
- sand_tex=LoadTexture("media/sand.bmp")
<br />
- ScaleTexture sand_tex,10,10
<br />
- EntityTexture ground,sand_tex
<br />
- EntityColor ground,168,133,55
<br />
-
<br />
- cactus1=LoadMesh("media/CACTUS2.x")
<br />
- cactus2=LoadMesh("media/CACTUS2.x")
<br />
- camel=LoadMesh("media/camel.x")
<br />
- PositionEntity cactus1,-1,2,10
<br />
- PositionEntity cactus2,1,2,10
<br />
- PositionEntity camel,0,1,1000
<br />
-
<br />
- ; Set initial zoom value
<br />
- zoom#=1
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
<br />
- If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
<br />
-
<br />
- ; Change zoom value depending on key pressed
<br />
- If KeyDown( 208 )=True Then zoom#=zoom#-0.1
<br />
- If KeyDown( 200 )=True Then zoom#=zoom#+0.1
<br />
-
<br />
- ; Put a minimum and maximum cap on zoom value
<br />
- If zoom#<1 Then zoom#=1
<br />
- If zoom#>100 Then zoom#=100
<br />
-
<br />
- ; Set camera zoom
<br />
- CameraZoom camera,zoom#
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use left and right cursor keys to turn around"
<br />
- Text 0,20,"Use up and down cursor keys to change camera zoom"
<br />
- Text 0,40,"There is a camel on the horizon, inbetween the cacti. Zoom in to see it."
<br />
- Text 0,60,"CameraZoom camera,"+zoom#
<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=CameraZoom&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|