[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: polygons
- To: ANDREW@UTOROISE.BITNET
- Subject: Re: polygons
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Tue, 19 May 1992 11:57:51 -0500
- Cc: info-mcl
>I am new to the mac interface and have no trouble with
>rectangles, lines ..........
>But two questions -
>I need to rotate rectangles. It appears that I must draw the rectangles
>as polygons due to the top-left,bottom-right nature of drawing rectangles
> -
>1) Is there an easy to rotate rectangles (or other objects)
>2) When defining a polygon as a first pass I'm using the following code:
...
Your points did not define a triangle (which I assume was your intention.
Also, the polygon handle is returned as the value of get-polygon. There
is noteed to rlet anything. Remember to deallocate the polygon
storage with kill-polygon.
(defparameter *w* (make-instance 'window :window-title "Balance-beam"
:view-position #@( 10 100)
:View-size #@(400 600)))
(with-focused-view *w*
(start-polygon *w*)
(#_moveto 160 225)
(#_lineto 200 210)
(#_lineto 240 225)
(#_lineto 160 225)
(let ((poly (get-polygon *w*)))
(paint-polygon *w* poly)
(kill-polygon poly)))
Actually, the functions in quickdraw.lisp aren't helping you much here.
You can just call the traps yourself:
(with-focused-view *w*
(with-macptrs ((poly (#_OpenPoly)))
(#_moveto 160 225)
(#_lineto 200 210)
(#_lineto 240 225)
(#_lineto 160 225)
(#_ClosePoly)
(#_PaintPoly poly)
(#_KillPoly poly)))
>
>I have loaded quickdraw -
>I do not get an error, but just an empty window!
>I think the problem is in the rlet line, as I am not sure how to give
>the polygon a temp name (reccord).
>Anyone who could send a simple example of polygons (very SIMPLE)
>and some info about rotations would save my week!!
QuickDraw has no support for rotations. You'll have to do it yourself.