Week 4–5, 4 Screenshots and Code
School for Poetic Computation, Week 5 Fall 2019
The four* in-progress screenshots I took of my Week 4 homework for Zach’s class feel like a good metaphor for my cycles of emotion, day by day, now that we’re around the half way point in our School For Poetic Computation adventure.
Sometimes everything feels orderly and like a gentle experiment, but with a mild underlying sense that it could all lead off into disorder and mystery

An hour later, everything feel like it is more confusing than it at first seemed

By lunch time everything feels like it’s moving very fast, it’s all exciting, all results are unintended, and there’s not enough time for anything

Finally, after eating and walking around, the world starts making sense again, but in a much more complex way than before

The picture above is my work-in-progress recreation of one of John Maeda’s Morisawa posters (this one). You might notice that the first three images above are solid letters while this last one is using outlines. Zach sent me some example code of how to get the letters to rotate without flying off into the distance, using an outline method. I thought, great! I began my project with filled-in letters, so it will be trivial to fill the outline back in once I get my letters rotating as they should! This turns out to not be the case, and filling the letters back in is actually very tricky.
Here is the code to begin setting up the text using outlines:
string messageText = "MOUWRAO";
int fontSize = 98;
font.load("frabk.ttf", fontSize, true, true, true);
vector <ofPath> myWord = font.getStringAsPoints(messageText, true, false);getStringAsPoints(messageText, true, false) is the key difference between what I was doing before, when the third argument was set to true. It turns out that setting this to false in order to setup the ofPath for ofPolyline was essentially discarding the information that is needed to create filled-in shapes. So even when I called a block that had, once upon a time, created a filled in word, and even added ofFill() to try to bring one of my filled-in words back, it was still an outline because the vector no longer had the data it needed to fill the letters in:
// ofFill() does nothing
for(int i=0; i < 7; i++){
ofFill();
myWord[i].draw(0, 100);
}The rest of the code that made the letters rotate properly was mostly determining where the center of each letter was, so it didn’t make sense that any of it would affect whether or not the letters could be filled in. We spent a long time looking at it to see if that could be the problem anyway, though:
for (int i=0; i< 100; i++){
ofSetColor(255, 255, 255, 255 / (i* 0.5));
for (int j=0; j<7; j++){
vector < ofPolyline > lines = myWord[j].getOutline();
ofRectangle bounds;
bool bSet = false;
for(int k=0; k < lines.size(); k++){
for(int l=0; l < lines[k].size(); l++){
if(bSet==false)bounds.setPosition(lines[k][l]);
else bounds.growToInclude(lines[k][l]);
bSet = true;
}
} // now that we've got the bounds, save the center
ofPoint center = bounds.getCenter();
//subtract the center to draw from (0,0)
for(int k=0; k < lines.size(); k++){
for(int l=0; l < lines[k].size(); l++){
// change the position of the line
lines[k][l] -= center;
}
}
ofPushMatrix();
ofTranslate(center.x, center.y + i * 10 + 200);
ofRotateYDeg(i * 708);//708 * 0.5);
ofRotateXDeg(i * 1092);//1092 * 0.5);
for(int k=0; k < lines.size(); k++){
//draw the transformed lines
lines[k].draw();
}
ofPopMatrix();
}
}
The reason I was confused was that everything was broken for a while when I first tried to get the example code to work, until I noticed that the third argument in getStringAsPoints had to be toggled to false and then it magically rendered as intended. That fix was practically an afterthought when I was trying to get it to work. I didn’t realize until Alex and finally Zach, also, dug in that the flag was the key to my misunderstanding of how getting an outline with ofPolyline works.
It might seem like a hassle to get surprised by something that turns out to be way harder than you’d think but it ended up being a helpful journey. I went to Alex for help and he was puzzled by how to do it, so he went to Zach for help and Zach assured Alex, who later assured me, that this was a hard thing to do. Alex and I both had felt a little like we might be missing something very basic, or maybe we were going crazy, so it was validating to learn that something we were struggling to figure out was actually hard and we didn’t have something wrong in the foundation of our knowledge of OpenFrameworks and C++.
It was an emotional whirlwind, but also one that is familiar at this point and bothers me less and less. It’s the feeling of looking everywhere for a bug in code, thinking you must have done something completely wrong, wondering why you can’t find your mistake, wondering if everything you know is wrong, only to realize after ages of retesting all assumptions that there’s a typo somewhere else and you were mostly thinking through the system correctly. I could be frustrated and angry at the time spent looking. Or I could be relieved that my whole world isn’t a lie. Or I could find it fun. I think I’m getting more and more attuned to the fun of it.
*for transparency, please note that I actually took way more than 4 screenshots that I then sifted through to find ones for this blog post that create the illusion that my process fits a narrative — never believe examples
