| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>ScaleEntity entity,x_scale#,y_scale#,z_scalel#,[,global]</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- entity - name of the entity to be scaled
<br />
- x_scale# - x size of entity
<br />
- y_scale# - y size of entity
<br />
- z_scale# - z size of entity
<br />
- global (optional) -
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Scales an entity so that it is of an absolute size.
<br />
-
<br />
- Scale values of 1,1,1 are the default size when creating/loading entities.
<br />
-
<br />
- Scale values of 2,2,2 will double the size of an entity.
<br />
-
<br />
- Scale values of 0,0,0 will make an entity disappear.
<br />
-
<br />
- Scale values of less than 0,0,0 will invert an entity and make it bigger.
- <br>
- <br>
- See also: <a class=small href=ScaleMesh.htm>ScaleMesh</a>, <a class=small href=FitMesh.htm>FitMesh</a>.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/ScaleEntity.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; ScaleEntity Example
<br />
- ; -------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
- light=CreateLight()
<br />
-
<br />
- cone=CreateCone( 32 )
<br />
- PositionEntity cone,0,0,5
<br />
-
<br />
- ; Set scale values so that cone is default size to begin with
<br />
- x_scale#=1
<br />
- y_scale#=1
<br />
- z_scale#=1
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- ; Change scale values depending on the key pressed
<br />
- If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1
<br />
- If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1
<br />
- If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1
<br />
- If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1
<br />
- If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1
<br />
- If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1
<br />
-
<br />
- ; Scale cone using scale values
<br />
- ScaleEntity cone,x_scale#,y_scale#,z_scale#
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor/A/Z keys to scale cone"
<br />
- Text 0,20,"X Scale: "+x_scale#
<br />
- Text 0,40,"Y Scale: "+y_scale#
<br />
- Text 0,60,"Z Scale: "+z_scale#
<br />
-
<br />
- Flip
<br />
-
<br />
- Wend
<br />
-
<br />
- End
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- 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>
- </html>
|