Skip to content

Instantly share code, notes, and snippets.

@nkgokul
Created March 11, 2023 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkgokul/d7ce75f07bbb9ec97f890687bc7ada30 to your computer and use it in GitHub Desktop.
Save nkgokul/d7ce75f07bbb9ec97f890687bc7ada30 to your computer and use it in GitHub Desktop.
mdGpjLo
function setup() {
createCanvas(700, 700, WEBGL);
}
function draw() {
background(200);
stroke(0);
noFill();
// Set up the camera
camera(0, 0, 100);
perspective(PI/3, width/height, 0.1, 500);
// Draw a cube
push();
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.02);
box(50,75,100);
pop();
}
setup();
draw();
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment