RotateMesh.htm 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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>RotateMesh mesh,pitch#,yaw#,roll#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. mesh - mesh handle <br />
  13. pitch# - pitch of mesh <br />
  14. yaw# - yaw of mesh <br />
  15. roll# - roll of mesh
  16. </td>
  17. </tr>
  18. </table>
  19. <h1>Description</h1>
  20. <table>
  21. <tr>
  22. <td>
  23. Rotates all vertices of a mesh by the specified rotation.
  24. <br>
  25. <br>
  26. See also: <a class=small href=RotateEntity.htm>RotateEntity</a>, <a class=small href=TurnEntity.htm>TurnEntity</a>.
  27. </td>
  28. </tr>
  29. </table>
  30. <h1><a href=../3d_examples/RotateMesh.bb>Example</a></h1>
  31. <table>
  32. <tr>
  33. <td>
  34. ; RotateMesh Example <br />
  35. ; ------------------ <br />
  36. <br />
  37. ; In this example we will demonstrate the use of the RotateMesh command. <br />
  38. <br />
  39. ; Unlike RotateEntity, RotateMesh actually modifies the actual mesh structure. <br />
  40. <br />
  41. ; So whereas using RotateEntity 0,45,0 would only rotate an entity by 45 degrees the first time it was <br />
  42. ; used, RotateMesh 0,45,0 will rotate the mesh every time it is used. <br />
  43. <br />
  44. ; This is because RotateEntity rotates an entity based on a fixed mesh structure, whereas RotateMesh <br />
  45. ; actually modifies the mesh structure itself. <br />
  46. <br />
  47. Graphics3D 640,480 <br />
  48. SetBuffer BackBuffer() <br />
  49. <br />
  50. camera=CreateCamera() <br />
  51. <br />
  52. light=CreateLight() <br />
  53. <br />
  54. ; Rotate light to give better lighting of cube <br />
  55. RotateEntity light,60,30,0 <br />
  56. <br />
  57. ; Create cube mesh <br />
  58. cube=CreateCube() <br />
  59. <br />
  60. ; Position cube in front of camera so we can see it <br />
  61. PositionEntity cube,0,0,5 <br />
  62. <br />
  63. While Not KeyDown(1) <br />
  64. <br />
  65. ; If space bar pressed then rotate mesh by 45 degrees on the y axis. Also set syntax$ text. <br />
  66. If KeyHit(57)=True Then RotateMesh cube,0,45,0 : syntax$="RotateMesh 0,45,0" <br />
  67. <br />
  68. RenderWorld <br />
  69. <br />
  70. Text 0,0,"Press space to rotate mesh by 45 degrees on the y axis" <br />
  71. Text 0,20,syntax$ <br />
  72. <br />
  73. Flip <br />
  74. <br />
  75. Wend <br />
  76. <br />
  77. End
  78. </td>
  79. </tr>
  80. </table>
  81. <br>
  82. <a target=_top href=../index.htm>Index</a><br>
  83. <br>
  84. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=RotateMesh&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  85. </html>