Search code examples
algorithmmodel3dprojectorgeometry-surface

Is there any algorithm for projecting images onto a non-flat surface?


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? projection

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.


Solution

  • 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:

    1. Decide on your projection point
    2. Decide on a bunch of lines emanating from your projection point that will give you resolution you need on your warped surface
    3. Determine where these lines intersect your surface (the exact method will depend on your surface representation)
    4. Assume that your flat image is placed somewhere between your projection point and warped surface and find the intersection of the line with the flat surface and assign this value to the location on the warped surface.

    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.