Ad

Amazing Movements

 Amazing Movements



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);
  background("red");
}

function draw() {
  background(250);
  rotateY(frameCount * 0.01);

  for (let j = 0; j < 5; j++) {
    push();
    for (let i = 0; i < 80; i++) {
      translate(
        sin(frameCount * 0.001 + j) * 100,
        sin(frameCount * 0.001 + j) * 100,
        i * 0.1
      );
      rotateZ(frameCount * 0.002);
      push();
      sphere(8, 6, 4);
      pop();
    }
    pop();
  }
}



Green Colour Movement code:

function setup() {
  createCanvas(710, 400, WEBGL);
}

function draw() {
  background(250);
  rotateY(frameCount * 0.01);

  for (let j = 0; j < 5; j++) {
    push();
    for (let i = 0; i < 80; i++) {
      translate(
        sin(frameCount * 0.001 + j) * 100,
        sin(frameCount * 0.001 + j) * 100,
        i * 0.1
      );
      rotateZ(frameCount * 0.002);
      push();
      fill("green");
      sphere(8, 6, 4);
      pop();
    }
    pop();
  }
}


So we have completed making our amazing movement education





 

Post a Comment

0 Comments