; CopyMesh Example ; ---------------- ; CopyMesh duplicates a mesh with its OWN copy of the geometry, so ; the copy can be edited without touching the original. (Use ; CopyEntity for simple repeated props: copies share geometry and ; render faster.) Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,0,-6 light=CreateLight() RotateEntity light,30,30,0 source=CreateCube() PositionEntity source,-2,0,0 EntityColor source,80,160,255 ; The documented command: an independent copy of the cube's mesh copy=CopyMesh(source) PositionEntity copy,2,0,0 EntityColor copy,255,150,70 ; Edit the COPY's geometry: only the right-hand mesh becomes a tower ScaleMesh copy,0.5,1.75,0.5 While Not KeyDown(1) TurnEntity source,0,1,0 TurnEntity copy,0,1,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Arrow keys: move camera Esc: exit" Text 0,20,"CopyMesh: the right-hand copy was reshaped independently" Flip Wend End