PositionMesh.htm 2.2 KB

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