ScaleMesh.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>ScaleMesh mesh,x_scale#,y_scale#,z_scale#</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. mesh - mesh handle <br />
  13. x_scale# - x scale of mesh <br />
  14. y_scale# - y scale of mesh <br />
  15. z_scale# - z scale of mesh
  16. </td>
  17. </tr>
  18. </table>
  19. <h1>Description</h1>
  20. <table>
  21. <tr>
  22. <td>
  23. Scales all vertices of a mesh by the specified scaling factors.
  24. <br>
  25. <br>
  26. See also: <a class=small href=FitMesh.htm>FitMesh</a>, <a class=small href=ScaleEntity.htm>ScaleEntity</a>.
  27. </td>
  28. </tr>
  29. </table>
  30. <h1><a href=../3d_examples/ScaleMesh.bb>Example</a></h1>
  31. <table>
  32. <tr>
  33. <td>
  34. ; ScaleMesh Example <br />
  35. ; ----------------- <br />
  36. <br />
  37. ; In this example we will demonstrate the use of the ScaleMesh command. <br />
  38. <br />
  39. ; Unlike ScaleEntity, ScaleMesh actually modifies the actual mesh structure. <br />
  40. <br />
  41. ; So whereas using ScaleEntity 2,2,2 would only double the size of an entity the first time it was <br />
  42. ; used, ScaleMesh 2,2,2 will double the size of the mesh every time it is used. <br />
  43. <br />
  44. ; This is because ScaleEntity scales an entity based on a fixed mesh structure, whereas ScaleMesh <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. ; 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 scale cube mesh by 1%. Also set syntax$ text. <br />
  63. If KeyHit(57)=True Then ScaleMesh cube,1.01,1.01,1.01 : syntax$="ScaleMesh 1.01,1.01,1.01" <br />
  64. <br />
  65. RenderWorld <br />
  66. <br />
  67. Text 0,0,"Press space to scale mesh by 1%" <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=ScaleMesh&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  82. </html>