I'm trying to use the Keystone library
http://keystonep5.sourceforge.net/ to keystone multiple surfaces but it doesn't seem to work.
The program seems to only be registering the first keystone which changes both surfaces?
This is what I have:
- import processing.opengl.*;
- import codeanticode.glgraphics.*;
- import deadpixel.keystone.*;
- GLGraphicsOffScreen offscreen1;
- Keystone ks1;
- CornerPinSurface surface1;
- GLGraphicsOffScreen offscreen2;
- Keystone ks2;
- CornerPinSurface surface2;
- void setup() {
- size(800, 600, GLConstants.GLGRAPHICS);
- offscreen1 = new GLGraphicsOffScreen(this, 200, 200);
- ks1 = new Keystone(this);
- surface1 = ks1.createCornerPinSurface(200, 200, 20);
- offscreen2 = new GLGraphicsOffScreen(this, 200, 200);
- ks2 = new Keystone(this);
- surface2 = ks2.createCornerPinSurface(200, 200, 20);
- }
- void draw() {
- // first draw the sketch offscreen
- offscreen1.beginDraw();
- offscreen1.background(255,0,0);
- offscreen1.endDraw();
- offscreen2.beginDraw();
- offscreen2.background(0,0,255);
- offscreen2.endDraw();
- background(0);
- surface1.render(offscreen1.getTexture());
- translate(300,0);
- surface2.render(offscreen2.getTexture());
- }
- // Controls for the Keystone object
- void keyPressed() {
- switch(key) {
- case '1':
- ks1.toggleCalibration();
- break;
- case '2':
- ks2.toggleCalibration();
- break;
- }
- }
1