| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>CameraViewport camera,x,y,width,height</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- camera - camera handle
<br />
- x - x coordinate of top left hand corner of viewport
<br />
- y - y coordinate of top left hand corner of viewport
<br />
- width - width of viewport
<br />
- height - height of viewport
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Sets the camera viewport position and size.
<br />
-
<br />
- The camera viewport is the area of the 2D screen that the 3D graphics as viewed by the camera are displayed in.
<br />
-
<br />
- Setting the camera viewport allows you to achieve spilt-screen and rear-view mirror effects.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/CameraViewport.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; CameraViewport Example
<br />
- ; ----------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- ; Create first camera
<br />
- cam1=CreateCamera()
<br />
-
<br />
- ; Set the first camera's viewport so that it fills the top half of the camera
<br />
- CameraViewport cam1,0,0,GraphicsWidth(),GraphicsHeight()/2
<br />
-
<br />
- ; Create second camera
<br />
- cam2=CreateCamera()
<br />
-
<br />
- ; Set the second camera's viewport so that it fills the bottom half of the camera
<br />
- CameraViewport cam2,0,GraphicsHeight()/2,GraphicsWidth(),GraphicsHeight()/2
<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 />
- PositionEntity plane,0,-1,0
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- If KeyDown( 205 )=True Then TurnEntity cam1,0,-1,0
<br />
- If KeyDown( 203 )=True Then TurnEntity cam1,0,1,0
<br />
- If KeyDown( 208 )=True Then MoveEntity cam1,0,0,-0.05
<br />
- If KeyDown( 200 )=True Then MoveEntity cam1,0,0,0.05
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor keys to move the first camera about the infinite plane"
<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=CameraViewport&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|