We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Greetings,
I'm working on java project that uses processing to draw objects to for projection onto a surface that is not dead on square with the projector. I'm trying to skew the canvas / processing output so the entire output can be adjusted to result in it's original ratio when it hit's its surface.
There doesn't seem to be a transform function to modify the canvas shape and size() only takes x and y. Using camera() adjustments in 2D resulted in harshly aliased(?) shapes and really doesn't handle x AND y corrections very well. (Picture placing the projector tilted up and to the rotated to the right in relation to the projection surface, for example.)
Gestalt had the ability to do this, but, upgrading the source seems to be turning into be a bigger headache than just creating a new solution.
It seems to me from following the gestalt code, I'm trying to skew the canvas that processing is drawing ON before processing gets it's hands on it, so the rest of the drawing and images display coordinates is happening ignorant of the skew.
Any clues would be grand as I've research the heck out of this and little is out there about skewing processing's overall output into it's framebuffer.
Thanks!
Answers
A different library provided my current solution:
I found a library for corner pin keystone adjustments and performs the task quite elegantly. Just click, hold and drag at the corners . You put in bread, you get toast.
Though, it's stated to only be tested up to Processing 2.0.3, for me at least, it's working fine with my 3.0.1 libraries and my java code.
One change I did have to make was to put everything into a PGraphics object. It was pretty simple all said and done. For example, just change over all your references to your PApplet object to a PGraphics object, and wrap all your calls to that object in beginDraw(): endDraw;
This link is where I found out about the keystone library with some example code that demonstrates it's usage.