Lecture: Dots
Dear students:
You made it back for a second day of CS 488. Me too. Have you been seeing everything in coordinates? When you move, are you thinking about your vector displacement? I hope not, but we will today in this class. I've got some activities planned that will get you thinking about location and offsets. We'll also write a rendererer or two.
Battlepoint
We'll be talking a lot about positions and vectors this semester, and you read about them for today. Let's warm up to these concepts with this little game of Battlepoint:
- Each partner claims a gridded markerboard, and each group one marker.
- Each partner secretly identifies an xy-position on the grid, with \(x, y \in \mathbb{N}\). That means the position is in quadrant 1.
- Each partner tracks their own progress by rotating the board 180 degrees, turning quadrant 3 into quadrant 1. Initially they are at the origin.
- Partners alternate in trying to guess the other's position. But they don't use coordinates. They use vectors. The guesser states a vector as an xy-offset from their current location.
- Both guesser and guessee track both their progressions in the appropriate quadrant.
- The guessee responds to a guess by giving the city-block distance between their current position and the target position. The city-block distance is the sum of the absolute differences on the xy-axes. How many blocks would a car have to drive to get there?
Lost Vertex
We often represent an ngon as a sequence of n
vertices. But what if we lost one of them? Could we recover it? Perhaps if we know something more about the shape. Suppose you know that the shape is a parallelogram. But you only have its first three vertices as you wind around its perimeter:
Can you compute a fourth? If so, write down an algorithm.
Then we'll build a little renderer that has the broken shape and restores its lost vertex.
Steps
In Thursday, you're going to be making shapes out of dots. These shapes will be parameterized, meaning there's going to be a little control overlaid on the canvas allowing the user to tweak the shape in some way. Let's make a parametric shape today to “ramp” up to that activity. How about a renderer that draws n
steps from the bottom left to the top right of the viewport?
TODO
Here's your list of things to do before we meet next:
See you next time.
Sincerely,
P.S. It's time for a haiku.