[Home] [Back to Message Index]

Global SchoolNet - Automated Message Archive

Re: LOGO-L> Berkeley Logo




George Mills (mills@softronix.com)
Mon, 20 Jan 1997 17:38:05 -0500

Brian Harvey wrote:
>
> > Logo should really should use multiple
> > pixels as the lowest resolution, so it has more room to maneuver.
>
> Don't you mean that it should use fractions of a pixel? Using
> multiple pixels would just make pictures more jagged than necessary.
>
> Some versions of Logo do, in fact, use fractional pixels as the
> unit of distance, but for a different reason: If you pick a
> really small unit, you can do all the geometric calculations in
> integer arithmetic, which makes drawing faster.
>
> But I'm not convinced that that would really help with the
> PENREVERSE problem; ultimately you have to reduce precision down
> to what the hardware can draw, and you'd want to draw most of the
> fractional-pixel units that make up the corner pixels anyway.
>
> The MSWLogo approach has its own failure cases, I think. For
> example, suppose we draw a square with the pen down (or reversing,
> since it won't matter in MSWLogo):
>
> repeat 4 [fd 100 rt 90]
>
> Now suppose I want to un-draw the top edge. So I say
>
> penup
> fd 100 rt 90
> penreverse ; or penerase -- I think it won't matter
> fd 100
>
> We are now left with a cup whose left edge is one pixel higher than
> its right edge. That seems undesirable to me.
>
> I can imagine a technique that would "do the right thing" in most
> cases, but would be pretty hard to explain or model. It's this:
> Logo can remember whether or not it has just drawn on the pixel
> under the turtle's position. "Drawn" includes penpaint or penreverse,
> even if the latter actually turned off the pixel. Then, whenever
> you move in penreverse, if that flag is set you refrain from drawing
> on the first pixel, but not otherwise.
>
> Does anyone have a situation in which this wouldn't do what the user
> wants? If not, I'll try it in Berkeley Logo.

The REAL problem is we want infinite resolution.
To help "simulate" a higher resolution you could require
each drawable cell be several pixels. This way you could
light up half a cell and be able to draw a line from the
center of one cell to the center of another, with out having
to decide whether each ending cell should be all on or all
off (which is the current problem).

This is just a theoretical point I'm making not a practical
one (today). Users want access to the lowest level of resolution
available (one pixel). By requiring multiple pixels for each cell
you of course reduce the level of resolution available to the user.
I think 4x4 pixels would work nice but still not perfect
(only an infinite number of pixels could be perfect)

Your comment about MSWLogo's uneven cup is correct. But I don't
think of it that way. If you had an Uneven cup 4x4 pixels, yes, you
would notice it. But if it was 100x100 you would not. Having
a square with 4 corners missing is more common and stands out more
and does not matter how big it is. I think inclusive on one
end and exclusive on the other solves more problems than it
creates and it just works out nice. It always lights up excatly the
number of pixels you ask the turtle to move. You can't draw unless
you move (when you mathematically calculate movements you might have
calculations that cancel out and come out zero, so FD 0 should not
draw a dot). It's also consistent with what Windows itself does
with rectangles etc.

Your idea of being smarter about the pixel under the turtle might
work. It also might create some new problems that you did not
expect. The user should understand how things are drawn and now
has control of them. The user should think of imaginary lines going
down the center of a pixel and being lit if they intersect.

Here is an acid test, what do think it should draw?

penreverse
fd 100
rt 179
fd 100

-- 
===============================================================
George Mills
email: mills@softronix.com
http://www.softronix.com
The www page contains some very powerful educational software.
Our single most important investment is our kids.

--------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.