// catherine's code, lauren's comments // // the main changes involve abstracting the // color set for the pen to be referred to // as a variable 'color' locally within // each loop. this allows one to change // tones easily as well as easily see // relative tones. // // the other changes focus around giving // more definition to the edges of the // shape. this is done by setting the // points on the edges to be a few tones // lighter or darker (depending on whether // we want a highlight or shadow) than the // fill tones. // // also note that the order in which the // shape is rendered has been altered in // order to make the inside of the // cylinder seem truly further away - now // the cylinder part is rendered last, so // it overlaps the inside part slightly. paper 100 set x 1 // right half of inside repeat a 0 25 { set color (50-((a*5)/3+25)) pen color line (a+50) (60+(((a+x)*(a+x))/100)) (a+50) (62+(10-(((a+x)*(a+x))/100))) set [(a+50) (60+(((a+x)*(a+x))/100))] (color + 10) set [(a+50) (62+(10-(((a+x)*(a+x))/100)))] (color - 10) } // left half of inside repeat a 0 25 { set color (50-(25-((a*5)/3))) pen color line (50-a) (60+(((x+a)*(x+a))/100)) (50-a) (62+(10-(((a+x)*(x+a))/100))) set [(50-a) (60+(((x+a)*(x+a))/100))] (color + 10) set [(50-a) (62+(10-(((a+x)*(x+a))/100)))] (color - 10) } // right half of cylinder repeat a 0 25 { set color ((a*5)/3+25) pen color line (a+50) (20+(((a+x)*(a+x))/100)) (a+50) (60+(((a+x)*(a+x))/100)) set [(a+50) (60+(((a+x)*(a+x))/100))] (color + 10) set [(a+50) (20+(((a+x)*(a+x))/100))] (color + 20) } // left half of cylinder repeat a 0 25 { set color (25-((a*5)/3)) pen color line (50-a) (20+(((x+a)*(x+a))/100)) (50-a) (60+(((a+x)*(x+a))/100)) set [(50-a) (20+(((x+a)*(x+a))/100))] (color + 20) set [(50-a) (60+(((a+x)*(x+a))/100))] (color + 20) }