Remarks: Processing Mazes

From Maze

(Difference between revisions)
Jump to: navigation, search
(Extending the paragraph about changing graphics)
(Making room for additional figures)
Line 8:Line 8:
The first Processing version of 10 PRINT was written to take advantage of the increased resolution of contemporary screens. It does this by making the thickness and ends of the lines into variables that can be changed while the program runs. The lines of the maze can range from 0.5 to 10 pixels wide and the lines can terminate with a rounded or square end. Like 10 PRINT, it maintains the grid of lines at 40 x 25 units, but unlike 10 PRINT it doesn't add each grid unit in sequence from left to right and top to bottom. In the new high-resolution version, the entire maze is refreshed in unison. Without thinking carefully about it, we used the default Processing colors to create white lines and a black background. In hindsight, this imbued the program with a distinct mood from the original lower-contrast blues of the C64. The result is shown in figures ?? to ??.
The first Processing version of 10 PRINT was written to take advantage of the increased resolution of contemporary screens. It does this by making the thickness and ends of the lines into variables that can be changed while the program runs. The lines of the maze can range from 0.5 to 10 pixels wide and the lines can terminate with a rounded or square end. Like 10 PRINT, it maintains the grid of lines at 40 x 25 units, but unlike 10 PRINT it doesn't add each grid unit in sequence from left to right and top to bottom. In the new high-resolution version, the entire maze is refreshed in unison. Without thinking carefully about it, we used the default Processing colors to create white lines and a black background. In hindsight, this imbued the program with a distinct mood from the original lower-contrast blues of the C64. The result is shown in figures ?? to ??.
 +
 +
[[File:P5-10PRINT-03.png|400px|thumb|center|]]
 +
[[File:P5-10PRINT-01.png|400px|thumb|center|]]
 +
[[File:P5-10PRINT-02.png|400px|thumb|center|]]
 +
 +
While we were creating these variations, we took the opportunity to make some additional quick changes to explore the visual aspects of the 10 PRINT maze. First, the 50-50 chance to draw a left or right line was altered so it could be weighted while the program ran to increase the chance of one line drawing instead of the other. The result is shown in Figures ?? to ??. Next, we tried drawing graphic symbols different from the diagonal lines to expose part of the programs structure. In our opinion, the essence of the 10 PRINT maze algorithm is to make a coin-toss, a 50-50 random decision, to draw a left or right diagonal line within a grid from left to right, top to bottom. The optical effect of the maze is created as the grid of diagonals align to produce walls and paths. Our eyes dance across the image as they attempt to find their way through the structure. As we quickly discovered through a few options, some symbols also create a strong, but different optical effect and other symbols generate a boring, flat graphic. Figure ?? shows the result of using a blank image (space) and circle in place of the diagonals. This quick exploration into applying a different visual skin to the fundamental coin-toss structure of the 10 PRINT program reveals that the appeal of 10 PRINT is derived from the random choice between one or more elements, the precise selection of which elements optically activate our eyes, and create a culturally relevant image, in this case, the maze.
While we were creating these variations, we took the opportunity to make some additional quick changes to explore the visual aspects of the 10 PRINT maze. First, the 50-50 chance to draw a left or right line was altered so it could be weighted while the program ran to increase the chance of one line drawing instead of the other. The result is shown in Figures ?? to ??. Next, we tried drawing graphic symbols different from the diagonal lines to expose part of the programs structure. In our opinion, the essence of the 10 PRINT maze algorithm is to make a coin-toss, a 50-50 random decision, to draw a left or right diagonal line within a grid from left to right, top to bottom. The optical effect of the maze is created as the grid of diagonals align to produce walls and paths. Our eyes dance across the image as they attempt to find their way through the structure. As we quickly discovered through a few options, some symbols also create a strong, but different optical effect and other symbols generate a boring, flat graphic. Figure ?? shows the result of using a blank image (space) and circle in place of the diagonals. This quick exploration into applying a different visual skin to the fundamental coin-toss structure of the 10 PRINT program reveals that the appeal of 10 PRINT is derived from the random choice between one or more elements, the precise selection of which elements optically activate our eyes, and create a culturally relevant image, in this case, the maze.
 +
 +
 +
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]
 +
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]
 +
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]
 +
It's important to note that these new changes could have been explored directly on the C64, but it was convenient to do to in Processing because Casey was writing this code and he was more fluent with that syntax than with BASIC. Every programmer is more familiar with some language than others. As with natural languages, it's easier to work through ideas in ones native tongue. The 10 PRINT variations to explore weighting the random value to have a higher percentage of one diagonal lines is created by changing the value after the decimal in 205.5:
It's important to note that these new changes could have been explored directly on the C64, but it was convenient to do to in Processing because Casey was writing this code and he was more fluent with that syntax than with BASIC. Every programmer is more familiar with some language than others. As with natural languages, it's easier to work through ideas in ones native tongue. The 10 PRINT variations to explore weighting the random value to have a higher percentage of one diagonal lines is created by changing the value after the decimal in 205.5:
Line 60:Line 72:
void draw() { print((random(1) < 0.5) ? '/' : '\\'); }
void draw() { print((random(1) < 0.5) ? '/' : '\\'); }
−
When the program is run in Processing, an empty display window opens, and the text is printed to the console as seen in Figure ??. This exploration raises an crucial difference between writing this program in BASIC for the C64 versus writing it in Processing. The one-line Programming program is a more similar program to the BASIC program, but it produces a divergent result. To achieve a more similar visual result, but program needs to be written from the different point of view expressed in Code ?? [We might need to number code as well as figure to refer to them within the text.].
+
When the program is run in Processing, an empty display window opens, and the text is printed to the console as seen in Figure ??. This exploration raises an crucial difference between writing this program in BASIC for the C64 versus writing it in Processing. The one-line Programming program is a more similar program to the BASIC program, but it produces a divergent result. To achieve a more similar visual result, but program needs to be written from the different point of view expressed in Code ?? [We might need to number code as well as figure to refer to them within the text].
 +
 +
 +
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]
 +
After evaluating the similarities and differences between the C64 and Processing programs, we realized that the line endings are a subtle, but crucial change within this program. In the original 10 PRINT image (see fig ??), notice how each line terminates into a point. This is required because each of the 40 x 25 tiles that comprise the maze are constrained to an 8 x 8 pixel area. This maze is created by tiling the lines, each constrained within a a 64 pixel square. In the Processing program, each line is free to extend beyond the boundaries that define a line. The screen in Processing is a continuous surface of pixels, each of which can be addressed precisely with an x- and y-coordinate rather than a tile position. The 10 PRINT program is comprised of 320 x 200 pixels, but the actual controllable resolution is 40 x 25, for a total of 1000 elements. A Processing version of the program can utilize all of the pixels on a contemporary screen which makes it possible to access millions of pixels. For example, a standard 1080p screen, provides 2,073,600 pixels to control.
After evaluating the similarities and differences between the C64 and Processing programs, we realized that the line endings are a subtle, but crucial change within this program. In the original 10 PRINT image (see fig ??), notice how each line terminates into a point. This is required because each of the 40 x 25 tiles that comprise the maze are constrained to an 8 x 8 pixel area. This maze is created by tiling the lines, each constrained within a a 64 pixel square. In the Processing program, each line is free to extend beyond the boundaries that define a line. The screen in Processing is a continuous surface of pixels, each of which can be addressed precisely with an x- and y-coordinate rather than a tile position. The 10 PRINT program is comprised of 320 x 200 pixels, but the actual controllable resolution is 40 x 25, for a total of 1000 elements. A Processing version of the program can utilize all of the pixels on a contemporary screen which makes it possible to access millions of pixels. For example, a standard 1080p screen, provides 2,073,600 pixels to control.
Line 90:Line 106:
The decision to display one direction of lines as white and the other as black triggers our evolved perception to create depth within this two-dimensional image. Our eyes inform us that there is a light source that is reflecting off one directional edge and creating a shadow on the other. The angle at which the lines terminate in this program enhance the affect by occlusion and terminating at the edge. This creates an isometric perspective which further enhances the perceived dimensionality in the image. These effects work well in some of the randomly determined configurations and are subverted by others.
The decision to display one direction of lines as white and the other as black triggers our evolved perception to create depth within this two-dimensional image. Our eyes inform us that there is a light source that is reflecting off one directional edge and creating a shadow on the other. The angle at which the lines terminate in this program enhance the affect by occlusion and terminating at the edge. This creates an isometric perspective which further enhances the perceived dimensionality in the image. These effects work well in some of the randomly determined configurations and are subverted by others.
−
After some reflection, we realized that despite all of the random options in the newly defined program, the line weight remains constant throughout. To check the visual effect of selecting a random line weight, we simply moved the code lines 6-8 to the beginning of the for loop. The result is shown in figures ?? and ??. At this stage, the program has moved significantly away from its parent and has emerged as a qualitatively unique algorithm.
 
−
 
−
 
−
[[File:P5-10PRINT-03.png|400px|thumb|center|]]
 
−
[[File:P5-10PRINT-01.png|400px|thumb|center|]]
 
−
[[File:P5-10PRINT-02.png|400px|thumb|center|]]
 
[[File:P5-10PRINT-105.png|400px|thumb|center|]]
[[File:P5-10PRINT-105.png|400px|thumb|center|]]
[[File:P5-10PRINT-212.png|400px|thumb|center|]]
[[File:P5-10PRINT-212.png|400px|thumb|center|]]
 +
 +
After some reflection, we realized that despite all of the random options in the newly defined program, the line weight remains constant throughout. To check the visual effect of selecting a random line weight, we simply moved the code lines 6-8 to the beginning of the for loop. The result is shown in figures ?? and ??. At this stage, the program has moved significantly away from its parent and has emerged as a qualitatively unique algorithm.
 +
 +
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]
 +
[[File:P5-10PRINT-XXX.png|400px|thumb|center|]]

Revision as of 19:09, 11 July 2011

View this revision of Remarks: Processing Mazes.

Personal tools