ScaleEntity.htm 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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>ScaleEntity entity,x_scale#,y_scale#,z_scalel#,[,global]</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. entity - name of the entity to be scaled <br />
  13. x_scale# - x size of entity <br />
  14. y_scale# - y size of entity <br />
  15. z_scale# - z size of entity <br />
  16. global (optional) -
  17. </td>
  18. </tr>
  19. </table>
  20. <h1>Description</h1>
  21. <table>
  22. <tr>
  23. <td>
  24. Scales an entity so that it is of an absolute size. <br />
  25. <br />
  26. Scale values of 1,1,1 are the default size when creating/loading entities. <br />
  27. <br />
  28. Scale values of 2,2,2 will double the size of an entity. <br />
  29. <br />
  30. Scale values of 0,0,0 will make an entity disappear. <br />
  31. <br />
  32. Scale values of less than 0,0,0 will invert an entity and make it bigger.
  33. <br>
  34. <br>
  35. See also: <a class=small href=ScaleMesh.htm>ScaleMesh</a>, <a class=small href=FitMesh.htm>FitMesh</a>.
  36. </td>
  37. </tr>
  38. </table>
  39. <h1><a href=../3d_examples/ScaleEntity.bb>Example</a></h1>
  40. <table>
  41. <tr>
  42. <td>
  43. ; ScaleEntity Example <br />
  44. ; ------------------- <br />
  45. <br />
  46. Graphics3D 640,480 <br />
  47. SetBuffer BackBuffer() <br />
  48. <br />
  49. camera=CreateCamera() <br />
  50. light=CreateLight() <br />
  51. <br />
  52. cone=CreateCone( 32 ) <br />
  53. PositionEntity cone,0,0,5 <br />
  54. <br />
  55. ; Set scale values so that cone is default size to begin with <br />
  56. x_scale#=1 <br />
  57. y_scale#=1 <br />
  58. z_scale#=1 <br />
  59. <br />
  60. While Not KeyDown( 1 ) <br />
  61. <br />
  62. ; Change scale values depending on the key pressed <br />
  63. If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1 <br />
  64. If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1 <br />
  65. If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1 <br />
  66. If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1 <br />
  67. If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1 <br />
  68. If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1 <br />
  69. <br />
  70. ; Scale cone using scale values <br />
  71. ScaleEntity cone,x_scale#,y_scale#,z_scale# <br />
  72. <br />
  73. RenderWorld <br />
  74. <br />
  75. Text 0,0,"Use cursor/A/Z keys to scale cone" <br />
  76. Text 0,20,"X Scale: "+x_scale# <br />
  77. Text 0,40,"Y Scale: "+y_scale# <br />
  78. Text 0,60,"Z Scale: "+z_scale# <br />
  79. <br />
  80. Flip <br />
  81. <br />
  82. Wend <br />
  83. <br />
  84. End
  85. </td>
  86. </tr>
  87. </table>
  88. <br>
  89. <a target=_top href=../index.htm>Index</a><br>
  90. <br>
  91. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=ScaleEntity&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  92. </html>