After getting started with Rune.js, I approached assignment #1:

On ITP’s laser printer, print your first generated Rune.js sketch. A few rules about your code: You can only use black (0) and white (255). You are only allowed to use triangle(), rect() and ellipse() once each, and no other drawing functions are allowed (no beginShape or images). Bring to class a design of an ice cream cone. Yes, an ice cream cone.

Within the design parameters, and my (limited) functioning knowledge of javascript, I met with several big challenges.

the Design

img_1171

The original design plan was to have an ice cream cone to appear on the ground, melting, the cone made up of many tiny triangles. Step 1 was to figure out the exact dimensions of a triangle. With professional studies of many over a decade behind me, sin and cos seemed like memories of another lifetime. Needless to say, after researching this, I ended up playing around with the numbers to get something close.

the Code

Unto the code was born the next challenge: how to use a for loop to get multiple instances of ellipses in varying sizes, only using the ellipse function once AND how to use a for loop to get multiple triangles to align together to form the cone.

After playing around with the triangle for loop first, I had no good leads, so I jumped over to the ellipse, where I was able to work out a varied spectrum of ellipses. I soon returned to the triangle for loops and found myself nesting wild results.

screen-shot-2016-09-10-at-9-01-33-pm screen-shot-2016-09-10-at-9-16-25-pm screen-shot-2016-09-10-at-9-20-43-pmscreen-shot-2016-09-10-at-7-57-10-pmscreen-shot-2016-09-10-at-7-50-23-pm screen-shot-2016-09-10-at-8-51-31-pm
screen-shot-2016-09-10-at-7-26-13-pm
screen-shot-2016-09-10-at-7-31-28-pmscreen-shot-2016-09-10-at-6-51-22-pm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After many attempts at getting a for loop to work, siting examples from Rune.js documentation, I was finally able to craft several iterations of possible ice cream cones, fitting within the constraints of the design challenge.

The Simple Cone

The Simple Cone

 

Snow Cone

Snow Cone

 

Single Scoop For Loop

Single Scoop For Loop