This project is read-only.

model deformation using projector

Sep 9, 2012 at 3: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!

Sep 9, 2012 at 11: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.


Sep 10, 2012 at 1: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.,r:17,s:90,i:59,r:17,s:90,i:59


thanks for answering!

Sep 10, 2012 at 4: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.


Sep 10, 2012 at 6:16 PM

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