USING CODE TO DRAW A RUBIK‘S CUBE
INTENTIONS
My goal was to create a 3D model using processing. Proportional, dimensional art can be quite difficult to draw by hand so I wanted to see how it worked on computer. It was easy to find patterns to make the drawing symmetrical. However, getting the initial shapes and lines correct was quite difficult. I tried to make pixel measurements using the Preview app on Mac but they were not very accurate which made the process tedious. I think using processing was a good way to practice conceptualizing dimensions because you must visualize them in a 2D way on an x, y plane.
PROCESS
Because I was unable to use the picture’s exact dimensions, I had to use my own calculations and my drawing is slightly different than the Motif. It is similar in the angle that the image sits at and shapes that are formed. There are many ways to go about drawing this but I chose to make three quadrilaterals. After drawing the quadrilaterals, I added four lines to each of the three sections. This produced the rubik’s cube grid appearance. Finally, I added the translate() function to center the drawing on the canvas. If I were to do it again, I would split it into smaller shapes so I can play more with the color variations (for example make it look unsolved).
RESULTS
I definitely think this way of drawing requires more analytical thinking so the process is more complex. This could be a good or bad thing depending on the goal of the art.
float x = 25; float y = 16.5; void setup(){ size(600,632); background(0); strokeWeight(8); stroke(0); } void draw(){ translate(x,y); fill(240,40,43); //red line(0,86,275,0); line(275,0,550,86); beginShape(); vertex(0,86); vertex(275,190); vertex(550,86); vertex(275,0); endShape(); line(70,110,335,20); //positive slope line(170,145,445,53); line(210,20,480,110); //negative slope line(110,53,380,145); fill(239,244,90); //yellow beginShape(); vertex(0,86); vertex(275,190); vertex(275,590); vertex(15,424); endShape(); line(5,210,275,330); //horizontal line(10,330,275,470); line(70,110,90,472); //vertical line(170,145,180,530); fill(40,72,214); //blue beginShape(); vertex(550,86); vertex(535,424); vertex(275,590); vertex(275,190); endShape(); line(275,330,540,200); //horizontal line(275,470,535,320); line(480,110,460,472); //vertical line(380,145,370,530); }
Leave a Reply