<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Exercise 17-9: Text mirror with any font</title>
	<atom:link href="http://www.learningprocessing.com/exercises/chapter-17/exercise-17-9/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningprocessing.com</link>
	<description>A Beginner's Guide to Programming Images, Animation, and Interaction by Daniel Shiffman</description>
	<lastBuildDate>Fri, 10 Feb 2012 19:58:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: JZ</title>
		<link>http://www.learningprocessing.com/exercises/chapter-17/exercise-17-9/comment-page-1/#comment-20713</link>
		<dc:creator>JZ</dc:creator>
		<pubDate>Sat, 28 Jan 2012 17:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1431#comment-20713</guid>
		<description>I got this mirror project (exercise 17-9) to work. Then I want to upgrade it to an object oriented sketch. It is not working the way I wanted. I would appreciate it if you could point out what went wrong. Thanks.

import processing.video.*;Capture video;int x, y, charcount, rows, cols;int videoScale = 16;PFont f;String myMessage = &quot;the quick brown fox jumps over the lazy dog. &quot;;Letter letters;void setup() {  size(640, 480);  smooth();  frameRate(30);  rows = height/videoScale;  // cols = width/videoScale; // my sketch didn&#039;t use it  video = new Capture (this, width, rows, 30);  f = createFont(&quot;Miso&quot;, 18, true);  textFont(f);  letters = new Letter();}void draw() {  background(70, 15, 100);  if (video.available()) video.read();  video.loadPixels();  //image(video,0,0,width,height);  // Use a variable to count through chars in String  charcount=0;  // begin loop for rows  for (int j=0; j&lt;rows; j++) {    // begin loop for columns    for (float x=0; x&lt;width; x++) {      color c = video.pixels[(int) x+j*video.width]; // add (int) because x is a float      y = j*videoScale;      char myChar = myMessage.charAt(charcount);      letters.display(x, y, c, myChar);            charcount = (charcount+1) % myMessage.length();            letters.moveX(x, myChar);      println(myMessage.charAt(charcount));          }  }}class Letter {  // char messageLetter;  // float x, y; // x, y show its current location  Letter() {  }  void display(float x_, float y_, color colr, char messageLetter) {    fill(colr);    textAlign(LEFT);    text(messageLetter, x_, y_);      }  void moveX (float x_, char messageLetter) {    // Move x according to character&#039;s width    x_ += textWidth(messageLetter);  }}</description>
		<content:encoded><![CDATA[<p>I got this mirror project (exercise 17-9) to work. Then I want to upgrade it to an object oriented sketch. It is not working the way I wanted. I would appreciate it if you could point out what went wrong. Thanks.</p>
<p>import processing.video.*;Capture video;int x, y, charcount, rows, cols;int videoScale = 16;PFont f;String myMessage = &#8220;the quick brown fox jumps over the lazy dog. &#8220;;Letter letters;void setup() {  size(640, 480);  smooth();  frameRate(30);  rows = height/videoScale;  // cols = width/videoScale; // my sketch didn&#8217;t use it  video = new Capture (this, width, rows, 30);  f = createFont(&#8220;Miso&#8221;, 18, true);  textFont(f);  letters = new Letter();}void draw() {  background(70, 15, 100);  if (video.available()) video.read();  video.loadPixels();  //image(video,0,0,width,height);  // Use a variable to count through chars in String  charcount=0;  // begin loop for rows  for (int j=0; j&lt;rows; j++) {    // begin loop for columns    for (float x=0; x&lt;width; x++) {      color c = video.pixels[(int) x+j*video.width]; // add (int) because x is a float      y = j*videoScale;      char myChar = myMessage.charAt(charcount);      letters.display(x, y, c, myChar);            charcount = (charcount+1) % myMessage.length();            letters.moveX(x, myChar);      println(myMessage.charAt(charcount));          }  }}class Letter {  // char messageLetter;  // float x, y; // x, y show its current location  Letter() {  }  void display(float x_, float y_, color colr, char messageLetter) {    fill(colr);    textAlign(LEFT);    text(messageLetter, x_, y_);      }  void moveX (float x_, char messageLetter) {    // Move x according to character&#039;s width    x_ += textWidth(messageLetter);  }}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.learningprocessing.com/exercises/chapter-17/exercise-17-9/comment-page-1/#comment-20664</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 22 Nov 2011 18:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1431#comment-20664</guid>
		<description>Great job!  A slight simplification:

  translate(width/2,height/2); //Translate to the center  rotateX(radians(60)); // rotate by 60 degrees  textAlign(CENTER);  text(message,0,y);  y--;</description>
		<content:encoded><![CDATA[<p>Great job!  A slight simplification:</p>
<p>  translate(width/2,height/2); //Translate to the center  rotateX(radians(60)); // rotate by 60 degrees  textAlign(CENTER);  text(message,0,y);  y&#8211;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott02127</title>
		<link>http://www.learningprocessing.com/exercises/chapter-17/exercise-17-9/comment-page-1/#comment-20663</link>
		<dc:creator>Scott02127</dc:creator>
		<pubDate>Tue, 22 Nov 2011 17:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1431#comment-20663</guid>
		<description>Go it working! Don&#039;t know if it is correct, but here is what I did for Exercise 17-8

PFont f;
String message = &quot;A long long timenIn a galaxy far far away&quot;;
float y = 0;

void setup(){
  size(600,600,P3D);
  f = createFont(&quot;Arial&quot;, 20*4, true);
}

void draw(){
  background(255);
  fill(0);
  textFont(f); // Set the font
  translate(width/2,height/2+y,y); //Translate to the center
  rotateX(radians(60)); // rotate by 60 degrees
  textAlign(CENTER);
  text(message,0,0);
  y--;
}
 </description>
		<content:encoded><![CDATA[<p>Go it working! Don&#8217;t know if it is correct, but here is what I did for Exercise 17-8</p>
<p>PFont f;<br />
String message = &#8220;A long long timenIn a galaxy far far away&#8221;;<br />
float y = 0;</p>
<p>void setup(){<br />
  size(600,600,P3D);<br />
  f = createFont(&#8220;Arial&#8221;, 20*4, true);<br />
}</p>
<p>void draw(){<br />
  background(255);<br />
  fill(0);<br />
  textFont(f); // Set the font<br />
  translate(width/2,height/2+y,y); //Translate to the center<br />
  rotateX(radians(60)); // rotate by 60 degrees<br />
  textAlign(CENTER);<br />
  text(message,0,0);<br />
  y&#8211;;<br />
}<br />
 </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott02127</title>
		<link>http://www.learningprocessing.com/exercises/chapter-17/exercise-17-9/comment-page-1/#comment-20662</link>
		<dc:creator>Scott02127</dc:creator>
		<pubDate>Tue, 22 Nov 2011 17:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningprocessing.com/?page_id=1431#comment-20662</guid>
		<description>Where is exercise 17-8??? I am having issues with it, and there is nothing on this site </description>
		<content:encoded><![CDATA[<p>Where is exercise 17-8??? I am having issues with it, and there is nothing on this site</p>
]]></content:encoded>
	</item>
</channel>
</rss>

