Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Can I set a video as my background();

$
0
0

Hello,

Here is what I;m trying to do. I would like to set a looping video as my background() image in my processing sketch. Then I want to import an OBJ and be able to rotate it in 3D space with my mouse. What I have so far is the video and the OBJ in the sketch but both acting as one piece. Here is my code so far. Any ideas?

import peasy.*; import processing.video.*;

PShape s;

String PATH = "/Users/brendanwilson/Desktop/Vidoe_Processing/video/data/comp.mov"; Movie mov;

PeasyCam cam;

void setup() { size(800, 800, P3D); smooth(); s = loadShape("rise.obj"); frameRate(30); mov = new Movie(this, PATH); mov.loop();

//CAMERA Click & Drag for rotation - Command & Drag for panning cam = new PeasyCam(this, 0, 0, 0, 50); cam.setMinimumDistance(0); cam.setMaximumDistance(1800);

}

void movieEvent(Movie m) { m.read();

}

void draw() {

directionalLight(126, 126, 126, 0, 0, -1); ambientLight(102, 102, 102); background(0); pushMatrix(); shape(s, 10, 10, 80, 80); popMatrix(); image(mov, 0, 0, width, height); }


Viewing all articles
Browse latest Browse all 2896

Trending Articles