I hope someone can help me. The problem that i have is that i have to use P3D for a library that i use. But i also want to make a simple drawing tool, where i can draw rectangles and ellipse on top of a image. Can someone help me with this?
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;
I want to make a mask tool for on a movie, first i draw on a movie then save that as a png and then load that in a keystone.
I have the code but i get a error:
The pixels array is null.
This is the code:
import deadpixel.keystone.*;
import processing.video.*;
Keystone ks;
CornerPinSurface surface;
PGraphics offscreen;
Movie mov;
boolean a = false;
PImage mask;
PGraphics topLayer;
void setup() {
// Keystone will only work with P3D or OPENGL renderers,
// since it relies on texture mapping to deform
size(800, 600, P3D);
ks = new Keystone(this);
surface = ks.createCornerPinSurface( 550, 400,10);
mask = loadImage("mask.png");
// We need an offscreen buffer to draw the surface we
// want projected
// note that we're matching the resolution of the
// CornerPinSurface.
// (The offscreen buffer can be P2D or P3D)
offscreen = createGraphics(550, 400, P2D);
topLayer = createGraphics(width, height, g.getClass().getName());
mov = new Movie(this, "animatie.mov");
mov.loop();
}
void movieEvent(Movie movie) {
mov.read();
}
void draw() {
// Convert the mouse coordinate into surface coordinates
// this will allow you to use mouse events inside the
// surface from your screen.
PVector surfaceMouse = surface.getTransformedMouse();