dxScaleMesh(mesh%,width#,height#,depth#)

Parameters

mesh - mesh handle
x_scale# - x scale of mesh
y_scale# - y scale of mesh
z_scale# - z scale of mesh

Description

Scales all vertices of a mesh by the specified scaling factors.

See also: dxFitMesh, dxScaleEntity.

Example

; dxScaleMesh Example
; -----------------

; In this example we will demonstrate the use of the dxScaleMesh command.

; Unlike dxScaleEntity, dxScaleMesh actually modifies the actual mesh structure.

; So whereas using dxScaleEntity 2,2,2 would only double the size of an entity the first time it was
; used, dxScaleMesh 2,2,2 will double the size of the mesh every time it is used.

; This is because dxScaleEntity scales an entity based on a fixed mesh structure, whereas dxScaleMesh
; actually modifies the mesh structure itself.

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()

light=dxCreateLight()

; Create cube mesh
cube=dxCreateCube()

; Position cube in front of camera so we can see it
dxPositionEntity cube,0,0,5

While Not dxKeyDown(1)

; If space bar pressed then scale cube mesh by 1%. Also set syntax$ dxText.
If dxKeyHit(57)=True Then dxScaleMesh cube,1.01,1.01,1.01 : syntax$="dxScaleMesh 1.01,1.01,1.01"

dxRenderWorld

dxText 0,0,"Press space to scale mesh by 1%"
dxText 0,20,syntax$

dxFlip

Wend

End

Index