dxScaleEntity(entity%,scale_x#,scale_y#,scale_z#,global)

Parameters

entity - name of the entity to be scaled
x_scale# - x size of entity
y_scale# - y size of entity
z_scale# - z size of entity
global (optional) -

Description

Scales an entity so that it is of an absolute size.

Scale values of 1,1,1 are the default size when creating/loading entities.

Scale values of 2,2,2 will double the size of an entity.

Scale values of 0,0,0 will make an entity disappear.

Scale values of less than 0,0,0 will invert an entity and make it bigger.

See also: dxScaleMesh, dxFitMesh.

Example

; dxScaleEntity Example
; -------------------

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()
light=dxCreateLight()

cone=dxCreateCone( 32 )
dxPositionEntity cone,0,0,5

; Set scale values so that cone is default size to begin with
x_scale#=1
y_scale#=1
z_scale#=1

While Not dxKeyDown( 1 )

; Change scale values depending on the key pressed
If dxKeyDown( 203 )=True Then x_scale#=x_scale#-0.1
If dxKeyDown( 205 )=True Then x_scale#=x_scale#+0.1
If dxKeyDown( 208 )=True Then y_scale#=y_scale#-0.1
If dxKeyDown( 200 )=True Then y_scale#=y_scale#+0.1
If dxKeyDown( 44 )=True Then z_scale#=z_scale#-0.1
If dxKeyDown( 30 )=True Then z_scale#=z_scale#+0.1

; Scale cone using scale values
dxScaleEntity cone,x_scale#,y_scale#,z_scale#

dxRenderWorld

dxText 0,0,"Use cursor/A/Z keys to scale cone"
dxText 0,20,"X Scale: "+x_scale#
dxText 0,40,"Y Scale: "+y_scale#
dxText 0,60,"Z Scale: "+z_scale#

dxFlip

Wend

End

Index