Montag, 13. Oktober 2014

Processing the third

Today we did some short pixel stuff.

color pink = color(255, 102, 204);
loadPixels();
for (int i = 0; i < (width*height/2)-width/2; i++) {
  pixels[i] = pink;
}
updatePixels();


Array containing the values for all the pixels in the display window. These values are of the color datatype. This array is the size of the display window. The index value defines the position of a value within the array. Before accessing this array, the data must loaded with the loadPixels() function. After the array data has been modified, the updatePixels() function must be run to update the changes. Without loadPixels(), running the code may (or will in future releases) result in a NullPointerException.

This line colours the pixels. You can choose different values or use a random colour. It says (in this exmaple) that als long as the value is under 1000, it has to follow what the code orders.

for (int i = 0; i < (1000;i+1)

Keine Kommentare:

Kommentar veröffentlichen

Hinweis: Nur ein Mitglied dieses Blogs kann Kommentare posten.