Commit cd720d7b authored by Dave Cooper's avatar Dave Cooper
Browse files

added more for geometry chapter.

parent daa8e0fc
(in-package :gdl-user)
(define-object positioned-boxes (base-object)
:computed-slots ((length 10)
(width (* (the length) +phi+))
(height (* (the width) +phi+)))
:objects ((box-1 :type 'box)
(box-2 :type 'box
:center (make-point (the width) 0 0))))
(in-package :gdl-user)
(define-object positioned-by-index (base-object)
:input-slots ((number-of-boxes 5))
:computed-slots ((length 10)
(width (* (the length) +phi+))
(height (* (the width) +phi+)))
:objects ((boxes :type 'box
:sequence (:size (the number-of-boxes))
:center (make-point (* (the width) (the-child index))
0 0))))
(in-package :gdl-user)
(define-object translate-by-index (base-object)
:input-slots ((number-of-boxes 5))
:computed-slots ((length 10)
(width (* (the length) +phi+))
(height (* (the width) +phi+)))
:objects ((boxes :type 'box
:sequence (:size (the number-of-boxes))
:center (translate (the center)
:right (* (the width) (the-child index))))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment