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 be writing a rendererer or two.
Battlepoint
You read about dots and vectors today, so let's start with a little warmup exercise that builds on that. Find a partner. Each of you secretly identifies a point in a small region of \(\mathbb{Z}^2\): \([-8, 8] \times [-8, 8]\). Take turns trying to locate each other's point. If your partner guesses correctly, congratulate them. If your partner guesses incorrectly, give them a vector of how far off they are, but give a vector of only absolute differences.
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. We'll examine several different shapes and see how we might go about repairing them. If we can repair them, we'll build a little renderer that randomly generates broken instances and restores their lost vertex.
Parallelogram
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 the fourth? If so, write down an algorithm.
Isosceles Triangle
Suppose you know that the shape is an isosceles triangle. But you only have its first two vertices as you wind around its perimeter:
Can you compute the third? If so, write down an algorithm.
Equilateral Triangle
Suppose you know that the shape is an equilateral triangle. But you only have its first two vertices as you wind around its perimeter:
Can you compute the third? If so, write down an algorithm.
Nsteps
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,