SweptPlatform

From MHCGraphics

Jump to: navigation, search
; Mead example file, simple model using a sweep
;
; Jim Teresco
; Computer Science 110
; Mount Holyoke College
; February 18, 2008
;
; $Id: SweptPlatform.scm 491 2008-02-19 01:45:27Z terescoj $
;
(require (lib "Defs.ss" "Mead"))

; First, we define a square on the xy-plane
(define square 
  (2to3d (polygon 4)))

; Transform our square into a "Little Rectangle" further
; out the x-axis
(define littleRectangle
  (polyXform square
             (xform
              (zRot 45)
              (scale 2 .1 1)
              (translate 200 0 0))))

; sweep our littleRectangle in 12 segments around the y-axis
; note that we could also define a name for the results of the
; sweep (it's a Mesh) and use it to build other objects, add
; copies to the scene, etc.
(tell scene
      (add (sweep littleRectangle 12) redPlaster))

(tell camera
      (pos '(0 200 -800))
      (shoot))
Personal tools