Picturesque verse
This is the project which i have not shared with my YouTube Community so let's start and see how to build it..This is a VIP Project
1. Open P5.js Editor
STEP 1- Go to google.com and search p5.js and click on the first option. 
STEP 2-Inside that option click on Home.
STEP 3-Then Click Start creating with p5 editor.
2. Create a New Project 
Code:
function setup() {
  createCanvas(710, 400, WEBGL);
}
function draw() {
  background(0);
  let locX = mouseX - height / 2;
  let locY = mouseY - width / 2;
  ambientLight(50);
  directionalLight(255, 0, 0, 0.25, 0.25, 0);
  pointLight(0, 0, 255, locX, locY, 250);
  push();
  translate(-width / 4, 0, 0);
  rotateZ(frameCount * 0.02);
  rotateX(frameCount * 0.02);
  specularMaterial(250);
  box(100, 100, 100);
  pop();
  translate(width / 4, 0, 0);
  ambientMaterial(250);
  sphere(120, 64);
}


0 Comments