dxCopyMesh%(entity%,parent%)

Parameters

mesh - handle of mesh to be copied
parent (optional) - handle of entity to be made parent of mesh

Description

Creates a copy of a mesh and returns the newly-created mesh's handle.

The difference between dxCopyMesh and dxCopyEntity is that dxCopyMesh performs a 'deep' copy of a mesh.

dxCopyMesh is identical to performing new_mesh=dxCreateMesh() : AddMesh mesh,new_mesh

Example

; dxCopyMesh Example
; ----------------

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()

light=dxCreateLight()
dxRotateEntity light,90,0,0

crate1=dxLoadMesh("media/wood-crate/wcrate1.3ds")
dxPositionEntity crate1,-40,0,100

crate2=dxCopyMesh(crate1)
dxPositionEntity crate2,40,0,100

While Not dxKeyDown(1)

dxTurnEntity crate1,1,1,1
dxTurnEntity crate2,1,1,-1

dxRenderWorld
dxFlip

Wend

End

Index