PeasyCam cam; String data[]; void setup() { //set the size of the screen. size(400, 400, P3D); //create the camera. cam = new PeasyCam(this, 30); //tell the camera what to look at. cam.lookAt(10, 0, 0); //read the file into data (an array) data = loadStrings("3trees.csv"); for (int i=0; i < data.length; i++) { print(data[i]); print("\n"); } } void draw() { background(0, 0, 0); for (int i = 1; i < data.length; i++) { pushMatrix(); String[] tree = split(data[i], ','); float x_position = float(tree[5]); float y_position = float(tree[6]); float dbh = float(tree[8])/100.0; float treeHeight = float(tree[10]); float crownBase = float(tree[11]); float radiusN = float(tree[12]); float radiusE = float(tree[13]); float radiusS = float(tree[14]); float radiusW = float(tree[15]); float crownRadius = (radiusN+radiusE+radiusS+radiusW)/4; translate(x_position, y_position, 0); fill(100,100,0); cone(dbh / 2, treeHeight); //trunk translate(0,0,crownBase); fill(112,219,147); cone(crownRadius, treeHeight-crownBase); //crown popMatrix(); } }