Help Completing code
in
Programming Questions
•
6 months ago
Ok so I am currently attempting to create a 2d simulation of cells for educational purposes. Anyway since im not very good with code I got someone to help me write it. So far we got a lot of it done but he has now gone on holiday and I need some help to complete the final part. Here is the current code:
- int [] tst = {0,1,2,3,4;
- void arrow(float x, float y, float sx, float sy)
- {
- line(x,y,x+sy,y+sy);
- line(x+sx,y+sy,x+sx-sy/pythagoras(sx,sy,0)*3/pythagoras(sx,sy,0|*3,y+sy+sx/pythagoras(sx,sy,0)*3-sy/pythagoras;
- line(x+sx,y+sy,x+sx-sy/pythagoras(sx,sy,0)*3/pythagoras(sx,sy,0|*3,y+sy+sx/pythagoras(sx,sy,0)*3-sy/pythagoras;
- }
- void setup()
- {
- size (800,600);
- stroke (255);
- background (0,0,0);
- tst = new cCell [16];
- framerate (20);
- PFont = font;
- font = createFont("Arial", 10);
- textFont(font);
- tst[0] = new cCell (400, 200, 20, 14000, 0);
- tst[1] = new cCell (300, 200, 20, 28000, 0);
- tst[2] = new cCell (150, 300, 20, 52000, 0);
- tst[3] = new cCell (250, 340, 20, 18000, 0);
- tst[4] = new cCell (450, 290, 20, 20000, 0);
- tst[5] = new cCell (450, 350, 20, 16000, 0);
- tst[6] = new cCell (510, 220, 20, 20000, 0);
- tst[7] = new cCell (530, 300, 20, 25000, 0);
- tst[8] = new cCell (420, 0, 20, 14000, 0);
- tst[9] = new cCell (300, 0, 20, 28000, 0);
- tst[10] = new cCell (150, 100, 20, 32000, 0);
- tst[11] = new cCell (250, 140, 20 , 18000, 0);
- tst[12] = new cCell (450, 90, 20, 20000, 0);
- tst[13] = new cCell (450, 160, 20, 20000, 0);
- tst[14] = new cCell (520, 20, 20, 20000, 0);
- tst[15] = new cCell (520, 100, 20, 25000, 0);
- float a = pythagoras(4,4,0);
- }
- void draw()
- {
- lights ();
- background(0);
- float cameraY = height/2.0;
- float fov = mouseX/float(width) * PI/2;
- float cameraZ = cameraY / tan(fov / 2.0);
- float aspect = float(width)/float(height);
- if (mousePressed)
- {
- aspect = aspect / 2.0;
- }
- smooth();
- pushMatrix();
- translate(scx, scy);
- rotate(sca/72*PI);
- noFill();
- line(0,350,400,550);
- line(600,450,400,550);
- line(600,450,1000,650);
- for (int i = 0; i < 16; i++)
- {
- fill(255,255,255,160);
- beignshape();
- for (int ii = 0; ii < tst[i].cc; ii++);
- {
- vertex(tst[i].cP[ii].x, tst[i].cP[ii].y);
- fill(255,255,255,160);
- }
- fill(255,255,255,160);
- endShape(CLOSE);
- }
- }
Any input would be great thanks.
1