class MyShape { float xPosition, yPosition, zPosition; //Required(Dont change): position data. // | // | 1 // |________> THIS IS WHERE YOU SHOULD DECLARE THE VARIABLES // // int a, b, c, d, e, f, g float l, w, h; // I am drawing a box so I am keeping track of length, width, height MyShape(float x, float y, float z, float dir, float speed, int colR, int colG, int colB, int alertLevel, int collisionTime, ArrayList tr) { // The vehicles when collides calls this constructor to create a shape. // The vehicles also pass all its properties through this constructor. // to create variation of the generated forms you can combine these variables. //required xPosition = x; yPosition = y; zPosition = z; // | // | 2 // |________> THIS IS WHERE YOU MAP THE VEHICLE PROPERTIES TO YOUR SHAPE PROPERTIES PARAMETRICALLY // // that is give the variable (a,b,c,...) values based on the information extracted from the vehicle // following is an example where vehicle properties are mapped on to the variables (l,w,h) of a box l = speed; // l -> mapped from speed of vehicle w = dir*2; // w -> mapped from direction of vehicle if(z<20){ // h -> mapped from the z position and the alertlevel of the vehicle h = random(20+20*alertLevel); } else { h = 1+ random(alertLevel); } // ideas - the speed of collision maybe used to make the // shapes taller. // ideas - terrain properties can also be used, but i wont give that to // you. figure out! } void draw() { pushMatrix(); pushStyle(); translate(xPosition, yPosition, zPosition); MakeMyShape(); popStyle(); popMatrix(); } void MakeMyShape() { // | // | 3 // |________> THIS IS WHERE YOU PASTE YOUR SHAPE GENERATION CODE // fill(255,200,100,80); stroke(0); translate(0,0, h/2); box(l,w,h); } }