Rotating tank of water (idea)
in
Programming Questions
•
1 year ago
two rotating positions
Level of liquid within a tank must be always horizontal and the areas of blue polygons are always the same..
Need help with vector mathematics.
Level of liquid within a tank must be always horizontal and the areas of blue polygons are always the same..
Need help with vector mathematics.
- //import processing.opengl.*;
- //import javax.media.opengl.GL;
- //PImage img;
- void setup() {
- size(800, 800);
- background(255);
- //strokeWeight(5);
- //img = loadImage("Matt.jpg");
- }
- void draw() {
- background(0);
- //image(img, 0, 0);
- smooth();
- pushMatrix();
- translate(mouseX, mouseY);
- rotate(radians(frameCount/2));
- beginShape();
- strokeWeight(7);
- fill(255);
- vertex( -150, -150 );
- vertex( -150, 150 );
- vertex( 150, 150 );
- vertex( 150, -150 );
- endShape(CLOSE);
- beginShape();
- noStroke();
- fill(0, 0, 240);
- vertex( -150, 150 );
- vertex( -150, -70 );
- vertex( 150, -70 );
- vertex( 150, 150 );
- endShape(CLOSE);
- popMatrix();
- }
1