model deformation using projector

Sep 9, 2012 at 2:29 PM

hi all,

I'm currently trying to implement an AR game using a handheld projector, with the camera for the marker tracking installed on the projector. The camera detects the marker, and the projector shows a model over it.

The issue is.. when the player points the projector-camera to a marker on the wall (from an angle other than 90°) the model draws itself with some deformation, because the projector is not alligned with the surface. This skew of the image is theoretically the same as how the markers are detected from the point of view of the camera.

My question is.. is there by any chance an easy way to compensate the deformation? to make the model look different on the computer screen depending on the angle, and when using a projector see it on the wall the way it should be? maybe someone thought about this before

thanks in advance!

Coordinator
Sep 9, 2012 at 10:46 PM

Never used projector with the framework, so not sure the exact cause, but I would guess that it's wrong aspect ratio or you need to calibrate your camera.

Ohan

Sep 10, 2012 at 12:17 AM

it's not about the aspect ratio or calibration. The cause is that the wall is in a diagonal position compared to the projector.. so the beam of light arrives bigger on one side of the image than in the other.. for example, a sphere will become an oval, a square becomes a sort of trapezoid... I don't know if I'm being clear, but it's a normal effect. Just thought maybe there was an easy way to compensate this in the framework. Some street painters use this deformation to achieve a 3D effect when you look at the painting from a specific angle. Here you can see an example of one of these street paintings when the pic is taken from different angles.

http://www.google.com.ar/imgres?start=90&um=1&hl=en&client=firefox-a&rls=org.mozilla:en-US:official&biw=1366&bih=666&tbm=isch&tbnid=WCBRsaEaibkgMM:&imgrefurl=http://www.emisora.org/labels/arte.htm&docid=dEwHtb6apMRopM&imgurl=http://www.emisora.org/uploaded_images/globe-746442.jpg&w=320&h=213&ei=ZjBNUOXtFoPI9QSqNg&zoom=1&iact=hc&vpx=1069&vpy=135&dur=849&hovh=170&hovw=256&tx=143&ty=102&sig=114507857960774922690&page=5&tbnh=139&tbnw=182&ndsp=24&ved=1t:429,r:17,s:90,i:59

http://www.google.com.ar/imgres?start=90&um=1&hl=en&client=firefox-a&rls=org.mozilla:en-US:official&biw=1366&bih=666&tbm=isch&tbnid=WCBRsaEaibkgMM:&imgrefurl=http://www.emisora.org/labels/arte.htm&docid=dEwHtb6apMRopM&imgurl=http://www.emisora.org/uploaded_images/globe-746442.jpg&w=320&h=213&ei=ZjBNUOXtFoPI9QSqNg&zoom=1&iact=hc&vpx=1069&vpy=135&dur=849&hovh=170&hovw=256&tx=143&ty=102&sig=114507857960774922690&page=5&tbnh=139&tbnw=182&ndsp=24&ved=1t:429,r:17,s:90,i:59

 

thanks for answering!

Coordinator
Sep 10, 2012 at 3:31 AM

In that case, the easiest way is: (all of the stuff below should be done in Draw(..) function in the given order)

1. Create a render target and draw the Goblin rendered scene to this render target (see Tutorial 16 on how to render the scene into a render target, which is basically a texture)

2. Use SpriteBatch class to draw this texture, and when you draw this texture, you can set the destination rectangle size, and you can achieve skew effect to offset the skew you get from the projector. You can compute the right skew based on the marker's transformation.

Ohan

Sep 10, 2012 at 5:16 PM

thanks Ohan, great idea. I'm going to try that.