Newsgroups: comp.lang.lisp.mcl
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!csn!news-1.csn.net!ncar!uchinews!kropp-duster.cs.uchicago.edu!user
From: t-mcdougal@uchicago.edu (Thomas McDougal)
Subject: Re: Q:drawing filled polygons
X-Nntp-Posting-Host: kropp-duster.cs.uchicago.edu
Message-ID: <t-mcdougal-0504961245200001@kropp-duster.cs.uchicago.edu>
Sender: news@midway.uchicago.edu (News Administrator)
Organization: University of Chicago -- Academic Computing Services
References: <3163E85A.59E2@cs.umass.edu>
Date: Fri, 5 Apr 1996 18:45:20 GMT
Lines: 52

In article <3163E85A.59E2@cs.umass.edu>, Matteo Schmill
<schmill@cs.umass.edu> wrote:

>I am currently working with MCL 3.0 and need to draw filled regular
>polygons. ... I'm sitting here trying to figure out the sequence of
>traps that will get me what I need.


Ok, with and without the quickdraw interface:

--- cut here ---

;;; a simple polygon

;;; First, using just the Quickdraw traps:

(let ((w (make-instance 'window
           :view-size #@(300 300))))
  (event-dispatch)  ; make sure that the window is completely open
  (with-focused-view w
    (#_moveTo 50 150)
    (let ((poly (#_openPoly)))
      (#_lineTo 100 50) 
      (#_lineTo 150 150)
      (#_lineTo 100 200)
      (#_lineTo 50 150)
      (#_closePoly)
      (#_paintPoly poly) 
      (#_killPoly poly))))


;;; Here using the MCL Quickdraw interface:

(require :quickdraw)

(let ((w (make-instance 'window
           :view-size #@(300 300))))
  (event-dispatch)  ; make sure that the window is completely open
  (move-to w 50 150)
  (start-polygon w)
  (line-to w 100 50)
  (line-to w 150 150)
  (line-to w 100 200)
  (line-to w 50 150)
  (let ((poly (get-polygon w)))
    (paint-polygon w poly)
    (kill-polygon poly)))

-- 
--
Thomas McDougal
t-mcdougal@uchicago.edu
