CreateCamera.htm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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>CreateCamera ( [parent] )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. parent (optional) - parent entity of camera
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Creates a camera entity and returns its handle. <br />
  21. <br />
  22. Without at least one camera, you won't be able to see anything in your 3D world. With more than one camera, you will be to achieve effect such as split-screen modes and rear-view mirrors. <br />
  23. <br />
  24. A camera can only render to the backbuffer. If you wish to display 3D graphics on an image or a texture then copy the contents of the backbuffer to the appropriate buffer. <br />
  25. <br />
  26. The optional parent parameter allow you to specify a parent entity for the camera so that when the parent is moved the child camera will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent. <br />
  27. <br />
  28. Specifying a parent entity will still result in the camera being created at position 0,0,0 rather than at the parent entity's position.
  29. </td>
  30. </tr>
  31. </table>
  32. <h1><a href=../3d_examples/CreateCamera.bb>Example</a></h1>
  33. <table>
  34. <tr>
  35. <td>
  36. ; CreateCamera Example <br />
  37. ; -------------------- <br />
  38. <br />
  39. Graphics3D 640,480 <br />
  40. SetBuffer BackBuffer() <br />
  41. <br />
  42. ; Create camera <br />
  43. camera=CreateCamera() <br />
  44. <br />
  45. light=CreateLight() <br />
  46. <br />
  47. cone=CreateCone() <br />
  48. PositionEntity cone,0,0,5 <br />
  49. <br />
  50. While Not KeyDown( 1 ) <br />
  51. RenderWorld <br />
  52. Flip <br />
  53. Wend <br />
  54. <br />
  55. End
  56. </td>
  57. </tr>
  58. </table>
  59. <br>
  60. <a target=_top href=../index.htm>Index</a><br>
  61. <br>
  62. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CreateCamera&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  63. </html>