CreateCube.htm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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>CreateCube( [parent] )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. [parent] (optional) - This allows you to set the parent entity of Cube.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Creates a cube mesh/entity and returns its handle. <br />
  21. <br />
  22. The cube will extend from -1,-1,-1 to +1,+1,+1. <br />
  23. <br />
  24. 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 />
  25. <br />
  26. 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 />
  27. <br />
  28. 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 />
  29. <br />
  30. See also: CreateSphere(), CreateCylinder(), CreateCone().
  31. </td>
  32. </tr>
  33. </table>
  34. <h1><a href=../3d_examples/CreateCube.bb>Example</a></h1>
  35. <table>
  36. <tr>
  37. <td>
  38. ; CreateCube Example <br />
  39. ; ------------------ <br />
  40. <br />
  41. Graphics3D 640,480 <br />
  42. SetBuffer BackBuffer() <br />
  43. <br />
  44. camera=CreateCamera() <br />
  45. <br />
  46. light=CreateLight() <br />
  47. RotateEntity light,90,0,0 <br />
  48. <br />
  49. ; Create cube <br />
  50. cube=CreateCube() <br />
  51. <br />
  52. PositionEntity cube,0,0,5 <br />
  53. <br />
  54. While Not KeyDown( 1 ) <br />
  55. RenderWorld <br />
  56. Flip <br />
  57. Wend <br />
  58. <br />
  59. End
  60. </td>
  61. </tr>
  62. </table>
  63. <br>
  64. <a target=_top href=../index.htm>Index</a><br>
  65. <br>
  66. 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>
  67. </html>