| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>CreatePlane ( [sub_divs][,parent] )</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- sub_divs (optional) - sub divisions of plane. Should be in the range 1-16. The default value is 1.
<br />
- parent (optional) - parent entity of plane
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Creates a plane entity and returns its handle.
<br />
-
<br />
- A plane entity is basically a flat, infinite 'ground'. It is useful for outdoor games where you never want the player to see/reach the edge of the game world.
<br />
-
<br />
- The optional sub_divs parameter determines how many sub divisions of polygons the plane will have. Although a plane is flat and so adding extra polygons will not make it smoother, adding more polygons will allow more vertices to be lit for more detailed lighting effects.
<br />
-
<br />
- The optional parent parameter allows you to specify a parent entity for the plane so that when the parent is moved the child plane 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 plane being created at position 0,0,0 rather than at the parent entity's position.
<br />
-
<br />
- See also: CreateMirror.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/CreatePlane.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; CreatePlane 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 />
- ; Create plane
<br />
- plane=CreatePlane()
<br />
-
<br />
- grass_tex=LoadTexture( "media/mossyground.bmp" )
<br />
-
<br />
- EntityTexture plane,grass_tex
<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 />
- If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
<br />
- If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor keys to move 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=CreatePlane&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|