Hey, guys. I recently learned about the peasycam library, thus how convenient and handy is, when it comes to mouse-driven camera rotation. So I tried to use the library in my recent project. The idea was to create a ring of 3 or more images (or planes with applied images as a texture) with the camera rotating around them.
I did my best for the most part and I succeeded in integrating the library within my sketch. However, I don’t know how to make my images spin around an invisible ring/ellipse. For example, I want to achieve an effect, similar to the one used in the following p5.js sketch, which I found while searching on openprocessing.org 3D Image Ring Sample - OpenProcessing To my regret, I am far away from understanding the p5.js syntax. So here is my code. Any ideas on how to fix it:
import peasy.*;
PeasyCam cam;
PImage img, img2, img3;
void setup(){
size(1920,1080,P3D);
cam = new PeasyCam(this, 500);
cam.setMinimumDistance(50);
cam.setMaximumDistance(5000);
img = loadImage("1.jpg");
img2 = loadImage("2.jpg");
img3 = loadImage("3.jpg");
}
void draw(){
rotateX(-.5);
rotateY(-.5);
background(0);
pushMatrix();
translate(CENTER,CENTER);
imageMode(CENTER);
img.resize(0,600);
image(img,width/2,height/2);
imageMode(CORNER);
img2.resize(0,600);
image(img2,width/9,height/18);
imageMode(CORNER);
img3.resize(0,600);
image(img3,width/1.4,height/1.75);
popMatrix();
}
P.S you can use whatever .jpg images you find. Just rename them to 1.jpg
and 2.jpg
Size doesn’t matter because they will be resized. Thanks in advance for any help you can rovide