EntityRoll.htm 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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>EntityRoll# ( entity[,global] )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. entity - name of entity that will have roll angle returned <br />
  13. global (optional) - true if the roll angle returned should be relative to 0 rather than a parent entity's roll angle. False by default.
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Returns the roll angle of an entity. <br />
  22. <br />
  23. The roll angle is also the z angle of an entity.
  24. </td>
  25. </tr>
  26. </table>
  27. <h1><a href=../3d_examples/EntityRoll.bb>Example</a></h1>
  28. <table>
  29. <tr>
  30. <td>
  31. ; EntityRoll Example <br />
  32. ; ------------------- <br />
  33. <br />
  34. Graphics3D 640,480 <br />
  35. SetBuffer BackBuffer() <br />
  36. <br />
  37. camera=CreateCamera() <br />
  38. light=CreateLight() <br />
  39. <br />
  40. cone=CreateCone( 32 ) <br />
  41. PositionEntity cone,0,0,5 <br />
  42. <br />
  43. While Not KeyDown( 1 ) <br />
  44. <br />
  45. pitch#=0 <br />
  46. yaw#=0 <br />
  47. roll#=0 <br />
  48. <br />
  49. If KeyDown( 208 )=True Then pitch#=-1 <br />
  50. If KeyDown( 200 )=True Then pitch#=1 <br />
  51. If KeyDown( 203 )=True Then yaw#=-1 <br />
  52. If KeyDown( 205 )=True Then yaw#=1 <br />
  53. If KeyDown( 45 )=True Then roll#=-1 <br />
  54. If KeyDown( 44 )=True Then roll#=1 <br />
  55. <br />
  56. TurnEntity cone,pitch#,yaw#,roll# <br />
  57. <br />
  58. RenderWorld <br />
  59. <br />
  60. Text 0,0,"Use cursor/Z/X keys to turn cone" <br />
  61. <br />
  62. ; Return entity roll angle of cone <br />
  63. Text 0,20,"Roll: "+EntityRoll#( cone ) <br />
  64. <br />
  65. Flip <br />
  66. <br />
  67. Wend <br />
  68. <br />
  69. End
  70. </td>
  71. </tr>
  72. </table>
  73. <br>
  74. <a target=_top href=../index.htm>Index</a><br>
  75. <br>
  76. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=EntityRoll&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  77. </html>