This is years later, but I have something to add to the discussion here. I just came across this section in the book, and also did not grasp the concept right away. Bill's answer is informative. I'm here to fill in a missing gap.
A frame is the box in which an image is painted. An image is a collection of pixels represented as vectors with colors that form an image. So, for example, the vector (0.5 . 0.5)
might have the color black, and the painter will paint that spot with black. In very simple terms.
When the painter paints the image in the frame, the painter "goes into" the frame and acts as if that's it's only point of reference. In other words, what looks like a diamond frame to us will be treated as a regular square frame sitting on its base to the painter. That is because the painter re-orients itself to see the frame from a different angle.
See Bill's (paint (rotate-45 einstein))
example. you can see that the same image is painted, just on a tilt. The painter is looking straight at the image in the same way it would if it were sitting on its base. It is only to our eyes that it seems as if the image is "skewed".
How does the painter 're-orient' itself?
Enter frame-coord-map
.
frame-coord-map
takes as its argument a frame. Let's say that the frame given is a regular, square frame sitting on it's base. That frame would be created thus:
(make-frame (make-vect 0.0 0.0)
(make-vect 1.0 0.0)
(make-vect 0.0 1.0))
The origin point is at the 0 of the x and y axes. Edge 1 stretches evenly to the end of the x-axis, and edge 2 to the y-axis.
frame-coord
will now take a vector – that is, a point within the frame – say, (0.1 . 0.5)
. In the above-defined frame, that represents the point slightly to the left of bottom-left corner, and halfway up. frame-coord
will return that very same vector – (0.1 . 0.5)
.
Now, let's say we gave frame-coord
a "tilted" frame. A 45-degree rotated, "skewed" frame. Such a frame would be defined thus:
(make-frame (make-vect 0.5 0.0)
(make-vect 1.0 0.5)
(make-vect 0.0 0.5)
If we gave the same vector – (0.1 . 0.5)
to frame-coord
now, we would get a different return value. Now, frame-coord
would return (0.6 . 0.3)
. The reason for that is because relative to the origin point (0.5 . 0)
, mapping the vector (0.1 . 0.5)
will produce (0.6 0.3)
. This concept carries over to other parallelograms. No matter the frame's origin and edges, the painter will be able to map the vectors of the image to the frame.
This is how the painter 're-orients' itself to any frame, and that is the importance of this function.