Final ICM second stage
The first step of my final was to create a php form for the users, so they can describe with one word United States.
Here is the link to the php form
The idea is to build a more creative site. One of the options would be to have a map of the United States in the background. The second would be the image of words describing United States in the backdrop. I would like to play with the opacity.
These are the errors on the first try of the php form:
Warning: fopen(data.txt) [function.fopen]: failed to open stream: Permission denied in /var/www/domains/linux.linamariagiraldo.com/docs/final/addword.php on line 24
Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/domains/linux.linamariagiraldo.com/docs/final/addword.php on line 28
Warning: fclose(): supplied argument is not a valid stream resource in /var/www/domains/linux.linamariagiraldo.com/docs/final/addword.php on line 29
Saved word = final
The first error is probably permissions of the data.txt file. After fixing the errors, it works fine with the only exception that its savings the words all together without spaces. Experimenting a little bit with the code, I found out that just adding a space before the world is I needed, It works. So finally I have a php code that can save words and be use for the next step …. Displaying the text.
For displaying the text I would like to try two drafts using earlier code from beginning of the semester and the midterm
With the midterm example I want to fix the programming so that the processing sketch is checking the data file for changes. If there is a change(a new word was added) the text file will be reloaded.
Here is the source code:

The current problem I have is that I need to load the data file inside of the draw instead of the setup. For this to work I imagine I need a conditional that checks the size of the data file against the variable that originally recorded the size. Every time the size changes we need to reload the data file and redraw the sketch
The next step is to create a conditional that checks the size of the data file and reload when needed
The sketch now is working fine and the text is displaying and doesn’t loop anymore.
The question here is how can I calculate the length of the array and the strings and compare to the one on the server?
I need to load the array
Measure the array
Compare the array
The next step is to create a counter for the text. I’m going to use the example from King Lear from Daniel Shifman’s book exercise 18
Now the words are displaying and have the counter included. They show up randomly. The ideal would be to have the size dependent on the number of times it is repeated.
This is my next challenge: how to display the images on the screen to narrow it a little bit. I’m going to concentrate first in the size and location of the word. I’ m not sure how to proceed yet. Here I decided it’s a good moment to stop and study the next steps.
I have a parallel idea with this project and it’s to grab images from yahoo. When the user types the word, the image is display. The example I’m studying is this example from Shifman:
http://www.shiffman.net/2007/08/05/processing-yahoo-search-library/
My other challenge is to create a more interesting display these are the examples I have reviewed:
http://www.m-i-b.com.ar/mib/letter_pairs/eng/applet/index.html
What I was recommended here is to implement the circle packing
Anyways, I visited a lot of different places looking for inspiration. I’m looking for displaying dynamic text that represents visually the opinion of the people that interact, here are the examples I found so far:
This is an example from Peter Cho, 2008
http://www.typotopo.com/wordscapes/wordscapes.html
This from Ben Fry, Valence
http://processing.org/exhibition/works/001/index_link.html
After playing and studying the code very carefully I realize that in order to change the size accordingly to the total of words I just need to multiply with the size of the font this is the change:
textFont(f,total*15); //Specify what font to use and the size depending on how
//many times is repeated
Also I would like to change the density of the color depending of the total of words.
First I divided 125 with 5, the result is 25, which multiplied by the total of words change the density of the color. My first problem was that the result was negative and the colors were pale and pinky. The solution to that problem was to create a constrain, so the color move between the range of 0 and 255.
int fillColor = constrain(225-(total*25),0,255);
fill(fillColor); // Font Fill color
Here is the exercise so far:
My next step is to animate the text. In order to achieve it, I need to works with objects. This is what I have to change:
x=random(width); //Set a random Value for X and Y to display text on screen y=random(height);
//Set a random Value for X and Y to display text on screen
textFont(f,total*15); //Specify what font to use and the size depending on how
// many times is repeated
// Using constrain
int fillColor = constrain(225-(total*25),0,255);
fill(fillColor); // Font Fill color
text(theword,x,y); // Display the text in the string theword in position (x,y)
Leave a Reply
You must be logged in to post a comment.


