Combine codes
in
Contributed Library Questions
•
6 months ago
Hello,
I have started a few topics about my warp/drawing tool.
Now i know that its not possible to combine my code but i am wondering is it possible to start the next code on a keypressed or something?
These are the codes:
I have started a few topics about my warp/drawing tool.
Now i know that its not possible to combine my code but i am wondering is it possible to start the next code on a keypressed or something?
These are the codes:
- //draw
import processing.video.*;
import deadpixel.keystone.*;
Movie mov;
PGraphics topLayer;
void setup()
{
size(displayWidth, displayHeight);
background(0);
frameRate(30);
mov = new Movie(this, "animatie.mov");
mov.loop();
topLayer = createGraphics(width, height, g.getClass().getName());
}
void movieEvent(Movie myMovie)
{
mov.read();
}
void draw()
{
image(mov, 0, 0);
topLayer.beginDraw();
topLayer.fill(1);
topLayer.ellipse( pmouseX, pmouseY, 50, 50 );
topLayer.endDraw();
image( topLayer, 0, 0 );
}
void keyPressed() {
switch(key) {
case 's':
topLayer.save(" mask.png" );
break;
}
}
- import deadpixel.keystone.*;
import processing.video.*;
Keystone ks;
CornerPinSurface surface;
PGraphics offscreen;
Movie mov;
PImage img;
void setup() {
size(displayWidth, displayHeight, P3D);
ks = new Keystone(this);
surface = ks.createCornerPinSurface( 1102, 620, 10);
offscreen = createGraphics(1102, 620, P3D);
mov = new Movie(this, "animatie.mov");
mov.loop();
img = loadImage(" 2.png");
}
void movieEvent(Movie movie) {
mov.read();
}
void draw() {
PVector surfaceMouse = surface.getTransformedMouse();
offscreen.background(128);
offscreen.beginDraw();
offscreen.image(mov, 0, 0);
offscreen.image(img, 0, 0);
offscreen.endDraw();
surface.render(offscreen);
}
1