Skip to content

Instantly share code, notes, and snippets.

@joelburget
Created April 24, 2013 19:31
Show Gist options
  • Save joelburget/5454875 to your computer and use it in GitHub Desktop.
Save joelburget/5454875 to your computer and use it in GitHub Desktop.
<!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