CreatePlane.htm 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>CreatePlane ( [sub_divs][,parent] )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. sub_divs (optional) - sub divisions of plane. Should be in the range 1-16. The default value is 1. <br />
  13. parent (optional) - parent entity of plane
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Creates a plane entity and returns its handle. <br />
  22. <br />
  23. 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 />
  24. <br />
  25. 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 />
  26. <br />
  27. 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 />
  28. <br />
  29. 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 />
  30. <br />
  31. See also: CreateMirror.
  32. </td>
  33. </tr>
  34. </table>
  35. <h1><a href=../3d_examples/CreatePlane.bb>Example</a></h1>
  36. <table>
  37. <tr>
  38. <td>
  39. ; CreatePlane Example <br />
  40. ; ------------------- <br />
  41. <br />
  42. Graphics3D 640,480 <br />
  43. SetBuffer BackBuffer() <br />
  44. <br />
  45. camera=CreateCamera() <br />
  46. PositionEntity camera,0,1,0 <br />
  47. <br />
  48. light=CreateLight() <br />
  49. RotateEntity light,90,0,0 <br />
  50. <br />
  51. ; Create plane <br />
  52. plane=CreatePlane() <br />
  53. <br />
  54. grass_tex=LoadTexture( "media/mossyground.bmp" ) <br />
  55. <br />
  56. EntityTexture plane,grass_tex <br />
  57. <br />
  58. While Not KeyDown( 1 ) <br />
  59. <br />
  60. If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0 <br />
  61. If KeyDown( 203 )=True Then TurnEntity camera,0,1,0 <br />
  62. If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05 <br />
  63. If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05 <br />
  64. <br />
  65. RenderWorld <br />
  66. <br />
  67. Text 0,0,"Use cursor keys to move about the infinite plane" <br />
  68. <br />
  69. Flip <br />
  70. <br />
  71. Wend <br />
  72. <br />
  73. End
  74. </td>
  75. </tr>
  76. </table>
  77. <br>
  78. <a target=_top href=../index.htm>Index</a><br>
  79. <br>
  80. 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>
  81. </html>