Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Constructing surface from a set of contours

Hybrid View

  1. #1
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162

    Constructing surface from a set of contours

    Click image for larger version. 

Name:	oriented_contours.jpg 
Views:	86 
Size:	25.4 KB 
ID:	959

    I have a number of contours which are oriented as shown inthe attached figure. I would like to construct surface from these set ofcontours. Could any one give me somesuggestions?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    You need a matching set of vertices on each contour then it is straight forward - you just create quad between to vertices. For your diagram you will need a lot of vertices or it won't give a good approximation. Google "lofting"

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162
    Yes, i googgled on lofting. There are some softwares like 3ds max, autodesk viz which do this. I am not sure whether I would write my own program or use those. I don't know how flexible those software are. As my contours will be extracted from images and will be set at differenr angle at different positions. Any further suggestion?

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    I have no thoughts on how to program it. I just thought if you looked at how they did it;, you could get an idea of how to program the same.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Nov 2012
    Location
    Bremen, Germany
    Posts
    149
    Without ever having done this I could imagine the following works:

    Create equal-size Bitmaps from the contours such that the arrow shown in the diagram would be the Z-axis and the contour is centered.

    Pick a Point on the contour from the first Image as starting Point.
    Chose a Point from the next Image that is on the contour such that the coordinate-difference between the 2 Points is minimal. Those two Points can be connected such that the 2 contours get connected.
    Move along the first contour for a number of Pixels based on the number of Pixels that are on the contour (this will make the tesselation more dense if the contour gets smaller). This Point is the 3rd Point of a quad or triangle. The fourth Point can be found by doing the same on the next contour-image.

    The most problematic Thing is to choose connectable points from two different contours I guess as there might be Freak-cases where the above algorithm would fail: In the above diagram the second contour's dent is problematic.

    On a second thought things are likely to be more complicated as minima require Special care or are likely to get lost if not tessellating with a very high Resolution.
    Last edited by hlewin; 01-27-2013 at 03:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •