Reputation: 66945
Is there any algorithm for projecting images onto a non-flat (deformed) surface?
It is not deformed too much. It is a really glassy surface covered with high-quality, durable tracing paper. I have a 3-dimensional model of it. How can I texturise it with a projector?
I want to write a program in C\C++\C# for Windows, which would be able to texturise any surface given by a 3-dimensional model using a projector.
I need an algorithm or open source libraries containing algorithms.
Upvotes: 5
Views: 1432
Reputation: 69192
It's not at all clear what algorithm a standard texturing library would use, and it's probably not a true projection, so if accuracy is important, you many need to do this yourself (or do some research into what specific algorithms are being used for a given library).
The basic algorithm is simple. Basically you just need to find where line emanating from your projection point intersect your surface. In more detail:
On the other hand, if your surface is described mathematically, there may be a simple equation for this, as would be the case, for example, if you were mapping a plane to a sphere.
Upvotes: 1
Reputation: 490178
Yes, there's an algorithm. Unless you really want to implement it on your own, it's probably easier to let an existing 3D graphics implementation do the job for you -- both OpenGL and DirectX will let you apply a texture to the surface of a 3D model. The NeHe tutorials include an example of the basic idea using OpenGL.
Upvotes: 3