Created
April 24, 2013 19:31
-
-
Save joelburget/5454875 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Gravity!</title> | |
<script src="processing.js"></script> | |
</head> | |
<body> | |
<canvas id="pjs" width="400" height="400"></canvas> | |
<script data-processing-target="pjs"> | |
var canvas = document.getElementById("pjs"); | |
var processing = new Processing(canvas, function(processing) { | |
with(processing) { | |
var pg = createGraphics(400, 400, P3D); | |
pg.beginDraw(); | |
pg.lights(); | |
pg.noStroke(); | |
pg.background(107, 152, 189); | |
pg.fill(125, 125, 125); | |
pg.translate(77, 88, -34); | |
pg.sphereDetail(60); | |
pg.sphere(50); | |
pg.translate(183, 163, 0); | |
pg.rotateX(0.5); | |
pg.rotateY(0.9); | |
pg.box(116); | |
pg.translate(50); | |
image(pg, 0, 0); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment