• Sculpture
  • Sound Objects
  • New Media
  • Experiments, Research
  • Archive
  • About
Menu

 Katya Rozanova

  • Sculpture
  • Sound Objects
  • New Media
  • Experiments, Research
  • Archive
  • About
Large GIF (570x454).gif

Exercise with WEBGL

January 25, 2018

We used WEBGL in Allison Parish's class on October 23rd and I created this in order to learn how to upload photos to 3D objects and how to manipulate directional and point lights.

Code

function setup() { 
  createCanvas(900, 600, WEBGL);
    img = loadImage("assets/ro_coffee.jpg");

} 

function draw() { 
  background(245);
  directionalLight(0, 0, 10, 3, 3, .8);
        pointLight(250, 250, 250, mouseX, mouseY, .70);

  for (let i = -5; i <5; i++){
    push();
      texture(img);

      translate(i *120, sin(frameCount*i*0.01)*50, 30);

    box(80, 80, 170);
    pop();
  }
}

In Computational Media
← Persistence AttemptYou Write →