// Demo nesting for csc220 assn4 NestingCSC220Fall2023 // From Assignment 4 STUDENT B: // STUDENT B 50%: Each student creates their own shape according to handout spec. // You must use 2D shapes only, with copies rotated in X, Y, and Z directions, and // nested to the degree given by global recursionDepth+1. PImage STUDENTIMAGE = null ; int imgwidth, imgheight ; float aspectRatio ; void setup() { size(1100, 900, P2D); frameRate(60); STUDENTIMAGE = loadImage("HikerApr2023.jpg"); imgwidth = STUDENTIMAGE.width ; imgheight = STUDENTIMAGE.height ; aspectRatio = float(imgheight) / imgwidth ; // STUDENTIMAGE.resize(300, round(aspectRatio * 300)); // aspectRatio = 1.0 ; background(255); imageMode(CENTER); } void draw() { int recursionDepth = 2 ; push(); translate(width/2, height/2); for (int depth = 0 ; depth <= recursionDepth ; depth = depth + 1) { push(); scale(1.0/(depth+1)); fill(0); stroke(0); rectMode(CENTER); rect(0, 0, 415, aspectRatio * 415); image(STUDENTIMAGE, 0, 0, 400, aspectRatio * 400); pop(); } pop(); }