Hello everyone I’ve created a code that can transform a three-dimensional content into holographic video for pyramid.
For the purposes of example, a three-dimensional shape taken from the Processing examples was used.
The content has been enclosed in a class called videoCreate. The algorithm provides for the adaptation of the video on LCD screens with different sizes in inches.
Visual material within the beginDraw() and endDraw() functions can be replaced with any design.
It is very interesting to make the video interactive using values coming from vibrational sensors placed on the holographic pyramid.
main Program:
PGraphics scene;
BlendingShapes shape = new BlendingShapes(1.18);
VideoCreate videoQuad = new VideoCreate();
int sceneSize;
void setup() {
fullScreen(P3D);
//size(760,760,P3D);
background(0);
frameRate(60);
sceneSize = height/3;
scene = createGraphics(sceneSize, sceneSize, P3D);
}
void draw() {
// beginDraw
scene.beginDraw();
shape.set();
shape.move();
shape.display();
scene.endDraw();
//Create a Holographic video in four clock face
videoQuad.videoOlogra();
}
class BlendingShapes:
class BlendingShapes {
float posz, scale;
float transparancy, xspeed, brightness;
BlendingShapes(float tempScale) {
posz = -300;
scale = tempScale;
transparancy = 30;
brightness = 100;
}
void set() {
scene.colorMode(HSB, 100, 100, 100, 100);
scene.noStroke();
scene.background(0);
scene.blendMode(ADD);
}
// Position, size, move
void move() {
scene.translate(sceneSize/2, sceneSize/2, posz);
scene.scale(scale);
int rot = frameCount;
scene.rotateZ(radians(90));
scene.rotateX(radians(rot/60.0f * 10));
scene.rotateY(radians(rot/60.0f * 30));
}
void display() {
for (int i = 0; i < 100; i++) {
scene.fill(map(i % 10, 0, 10, 0, 100), 100, 100, transparancy);
scene.beginShape(TRIANGLES);
scene.vertex(200, 50, -50);
scene.vertex(100, 100, 50);
scene.vertex(100, 0, 20);
scene.endShape();
scene.rotateY(radians(270.0f/100));
}
}
}
class VideoCreate:
class VideoCreate {
VideoCreate() {
}
void videoOlogra() {
//Scenes Translate and Rotate
//TOP
translate(width/2-sceneSize/2, 0);
pushMatrix();
image(scene, 0, 0);
popMatrix();
//RIGHT
translate((sceneSize*2)-1,(height/2)-(sceneSize/2)-1);
pushMatrix();
rotate(PI/2);
image(scene, 0, 0);
popMatrix();
//DOWN
translate(-sceneSize+1,(sceneSize*2)-1);
pushMatrix();
rotate(PI);
image(scene, 0, 0);
popMatrix();
//LEFT
translate((-sceneSize*2)+1,-sceneSize+1);
pushMatrix();
rotate(3*PI/2);
image(scene, 0, 0);
popMatrix();
}
}
For any clarification I am here.
Thank you!