sub_divs (optional) - sub divisions of plane. Should be in the range 1-16. The default value is 1. parent (optional) - parent entity of plane |
Creates a plane entity and returns its handle. 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. 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. 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. 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. See also: CreateMirror. |
; dxCreatePlane Example ; ------------------- dxGraphics3D 640,480 dxSetBuffer dxBackBuffer() camera=dxCreateCamera() dxPositionEntity camera,0,1,0 light=dxCreateLight() dxRotateEntity light,90,0,0 ; Create plane plane=dxCreatePlane() grass_tex=dxLoadTexture( "media/mossyground.bmp" ) dxEntityTexture plane,grass_tex While Not dxKeyDown( 1 ) If dxKeyDown( 205 )=True Then dxTurnEntity camera,0,-1,0 If dxKeyDown( 203 )=True Then dxTurnEntity camera,0,1,0 If dxKeyDown( 208 )=True Then dxMoveEntity camera,0,0,-0.05 If dxKeyDown( 200 )=True Then dxMoveEntity camera,0,0,0.05 dxRenderWorld dxText 0,0,"Use cursor keys to move about the infinite plane" dxFlip Wend End |