From MHCGraphics
; A Mesh-based cube. (c) 2007 duane a. bailey
;
; Modified by Jim Teresco, Mount Holyoke College
; Computer Science 110
; 2/10/2008
;
; $Id: MeshCube.scm 473 2008-02-13 03:42:44Z terescoj $
;
(require (lib "Defs.ss" "Mead"))
; Define a polygon for the front face of a cube, which,
; like the default cube is 100x100x100 and centered at
; the origin
(define front
'((-50 -50 -50) (50 -50 -50)
(50 50 -50) (-50 50 -50)))
; Define our box repeatedly using the face, rotated
; appropriately, to define the six sides
(object box Mesh
(addPoly front)
(addPoly (polyXform front (xRot 90))) ; top
(addPoly (polyXform front (xRot 180))) ; back
(addPoly (polyXform front (xRot -90))) ; bottom
(addPoly (polyXform front (yRot 90))) ; left
(addPoly (polyXform front (yRot -90))) ; right
)
(tell scene
(add box)
)
(tell camera
(pos '(500 0 0))
(shoot)
)