We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Keystone correction via processing
Page Index Toggle Pages: 1
Keystone correction via processing (Read 1796 times)
Keystone correction via processing
Apr 7th, 2009, 9:15am
 
One of our latest project has been building our own reactable and doing the GUI in processing. I am new to processing, but have a basic knowledge of the Java2D libraries and OpenGL. Our setup includes a table with a projector underneath that shoots from one end of the table into a mirror on the opposite end, that reflects up onto diffusing plexiglass on the tabletop.

This system works well in that it covers the entire top, but there is a major problem with distortion as you can imagine. You get an insane amount of keystoning. Since we're making this multiplatform, I wanted to include the keystoning correction directly into the processing app. Is there an easy way to go about this? I was looking at OpenGL's ortho and perspective, and perspective seems like it could end up being a good solution for my problem.

Then again I'm not totally sure. Does anyone have any experience with a similar problem, or is able to lend a helping reply?

Thanks very much,
Jake
Re: Keystone correction via processing
Reply #1 - Apr 7th, 2009, 2:27pm
 
An easy but probably slower way would be to create a seperate PGraphics object that you do all your rendering to, then in your main draw loop render the graphics buffer with a skewed quad. Otherwise I'm pretty sure you'll have to figure out how to apply a skew to the projection matrix correctly.

Something like:
skewedProjMatrix = skewMatrix * oldProjMatrix

Since you want the skew to be applied after the projection. I have no idea if it would work though.

Hope that's some help.

Jack
Re: Keystone correction via processing
Reply #2 - Apr 7th, 2009, 5:12pm
 
Maybe you should take a look at at the Gestalt Library, you can use a sketch as a texture and map it to a shape


http://www.the-product.org/gestalt/#examples
Re: Keystone correction via processing
Reply #3 - Apr 8th, 2009, 3:29pm
 
WebDext and cedric: Thanks much for your answer! I actually ended up using a combination of the two ideas here, as I implemented the gestalt texture-on-a-plane awesomeness, but eventually had to use a skew matrix to turn that into what was an effective keystone correction function.

Thanks much! If anyone needs the code immediately, I'm more than happy to share. Otherwise, it'll be released opensource when the project is nearer to completion.
Re: Keystone correction via processing
Reply #4 - Apr 8th, 2009, 3:41pm
 
sounds great. maybe you can add it to the hacks section and link it here. Sounds like a problem a lot of people have to deal with once in a while.

Re: Keystone correction via processing
Reply #5 - May 3rd, 2009, 5:53am
 
Hi great accomplishment...
Can I get the code? I would really have use for that Smiley
Re: Keystone correction via processing
Reply #6 - May 3rd, 2009, 7:05am
 
Hi,

think also Jonathan Feinberg`s Patchy library can be used very good as a keystone correction.

Similiar to the code I posted in the topic OpenGL .../ Video in 3D  

This way you can distort the projection also on curved surfaces.
Page Index Toggle Pages: 1