Entire output skewing - keystone correction

edited February 2016 in Library Questions

Greetings,

I'm working with some legacy code that was using processing 1.0 to draw images and gestalt to skew the entire output so that when the whole sketch was projected at skewed angle from a projector, it could be adjusted to result in it's original ratio.

Since I was experiencing an issue where using p.text() was preventing further stable operation of processing, I decided to take the plunge and upgrade everything, java JDk, processing, etc... but processing 3.x doesn't include gestalt any more and my research isn't finding an answer to it's direct replacement though I assume it's not included due to it's code being dormant since 2008.

Any help on getting it to function or more likely what is serving as it's replacement would be grand.

Thanks for reading!

Answers

  • the github repo is only 3 years out of date...

    https://github.com/TheProduct/Gestalt

  • Thank you, koogs. Not sure how I missed that, or what I was looking at before. Probably an old repo before they moved to github.

    The things that were being used in my code, have been depreciated in and a lot of semantics changed around in this release due to errors they apparently didn't want to address so this will take some fiddling to see if the same thing can be done.

    I'm no expert, but I'll see what I can shake out of the source.

    Thanks again.

  • I've taken a swing at upgrading the gestalt code since it's seemingly not doing much but what needs to be done is to change how it does business away from fixed-function with OpenGL.

    _myContext.gl = ((PGraphicsOpenGL)parent.g).gl

    in Gestalt.java is a line that's a good example.

    It's attempting to make an object to get it's opengl (GL) references from and gl has been depreciated. The revisions.txt states:

    • Removed support for fixed-function pipeline in OpenGL. I'm told this "brings us out of the 90s" and gets things a bit more up-to-date and compatible across many platforms and varying device types.

    Fair enough, but it seems that upgrading this is going to be a hassle and begs the original question if processing can do this or, what is the modern way of handing this with processing hooks into OpenGL?

    FYI ... I asked this question again in the different group, Programming Questions, to see if I could garner some visibility in that more general group.

  • 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 back 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.

Sign In or Register to comment.