Files
BlitzNext/_release/help/commands/3d_commands/CreateCube.htm
T
2014-12-08 12:43:20 +13:00

68 lines
1.9 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>CreateCube( [parent] )</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
[parent] (optional) - This allows you to set the parent entity of Cube.
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Creates a cube mesh/entity and returns its handle.
<br />
<br />
The cube will extend from -1,-1,-1 to +1,+1,+1.
<br />
<br />
The optional parent parameter allow you to specify a parent entity for the cube so that when the parent is moved the child cube 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 cube being created at position 0,0,0 rather than at the parent entity's position.
<br />
<br />
Creation of cubes, cylinders and cones are a great way of getting scenes set up quickly, as they can act as placeholders for more complex pre-modeled meshes later on in program development.
<br />
<br />
See also: CreateSphere(), CreateCylinder(), CreateCone().
</td>
</tr>
</table>
<h1><a href=../3d_examples/CreateCube.bb>Example</a></h1>
<table>
<tr>
<td>
; CreateCube Example
<br />
; ------------------
<br />
<br />
Graphics3D 640,480
<br />
SetBuffer BackBuffer()
<br />
<br />
camera=CreateCamera()
<br />
<br />
light=CreateLight()
<br />
RotateEntity light,90,0,0
<br />
<br />
; Create cube
<br />
cube=CreateCube()
<br />
<br />
PositionEntity cube,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=CreateCube&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>