-
Notifications
You must be signed in to change notification settings - Fork 0
/
glowdome3d.pde
44 lines (32 loc) · 952 Bytes
/
glowdome3d.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import shapes3d.utils.*;
import shapes3d.animation.*;
import shapes3d.*;
class Glowdome3d {
Ellipsoid earth;
public void setup(PApplet applet) {
earth = new Ellipsoid(applet, 16, 16);
earth.setTexture("pattern3.png");
earth.setRadius(180);
earth.moveTo(new PVector(0, 0, 0));
earth.strokeWeight(1.0f);
earth.stroke(color(255, 255, 0));
earth.moveTo(20, 40, -80);
earth.tag = "Earth";
earth.drawMode(Shape3D.TEXTURE);
}
public void render(PVector handsDelta) {
pushStyle();
// Change the rotations before drawing
earth.rotateBy(radians(handsDelta.y), radians(handsDelta.x), 0);
//background(0);
pushMatrix();
camera(0, -190, 350, 0, 0, 0, 0, 1, 0);
lights();
// Draw the earth (will cause all added shapes
// to be drawn i.e. the moon)
earth.draw();
//stars.draw();
popMatrix();
popStyle();
}
}