Commit 306eda7e authored by i❤computers's avatar i❤computers

See what multiple instances of BinarySpheres look like

parent d208b00e
......@@ -12,6 +12,7 @@
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>
<script src="classes/BinarySphere.js"></script>
<script src="sketch.js"></script>
</body>
</html>
\ No newline at end of file
let angle = 0;
let binary1, binary2, binary3;
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
binary1 = new BinarySphere();
binary2 = new BinarySphere();
binary3 = new BinarySphere();
}
function windowResized() {
......@@ -10,19 +12,18 @@ function windowResized() {
function draw() {
background(175);
binary1.rotate();
binary1.draw();
fill(0);
rotateY(angle);
binary2.rotate();
push();
translate(100, 0);
sphere(100);
translate(0, 150);
binary2.draw();
pop();
binary3.rotate();
push();
translate(-100, 0);
sphere(100);
translate(0, -150);
binary3.draw();
pop();
angle += 0.07;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment