64 lines
1.9 KiB
HTML
64 lines
1.9 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>CreateCamera ( [parent] )</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
parent (optional) - parent entity of camera
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Creates a camera entity and returns its handle.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
Without at least one camera, you won't be able to see anything in your 3D world. With more than one camera, you will be to achieve effect such as split-screen modes and rear-view mirrors.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
A camera can only render to the backbuffer. If you wish to display 3D graphics on an image or a texture then copy the contents of the backbuffer to the appropriate buffer.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The optional parent parameter allow you to specify a parent entity for the camera so that when the parent is moved the child camera will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
Specifying a parent entity will still result in the camera being created at position 0,0,0 rather than at the parent entity's position.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../3d_examples/CreateCamera.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; CreateCamera Example
|
|
<br />
|
|
; --------------------
|
|
<br />
|
|
|
|
<br />
|
|
Graphics3D 640,480
|
|
<br />
|
|
SetBuffer BackBuffer()
|
|
<br />
|
|
|
|
<br />
|
|
; Create camera
|
|
<br />
|
|
camera=CreateCamera()
|
|
<br />
|
|
|
|
<br />
|
|
light=CreateLight()
|
|
<br />
|
|
|
|
<br />
|
|
cone=CreateCone()
|
|
<br />
|
|
PositionEntity cone,0,0,5
|
|
<br />
|
|
|
|
<br />
|
|
While Not KeyDown( 1 )
|
|
<br />
|
|
RenderWorld
|
|
<br />
|
|
Flip
|
|
<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=CreateCamera&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|