Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: generate contour from the 3D model

  1. #1
    Intern Contributor
    Join Date
    Feb 2013
    Posts
    75

    generate contour from the 3D model

    Hello forum,

    I have to create contour around the 3D model . Can anyone refer me to any algorithms that does it efficiently ?


    Thanks

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    387
    Don't understand your question. Can U provide an example - perhaps pictures of a 3D model with and without the 'contour'?

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,411
    Contours, or a silhouette?

    How is the model represented? Triangle mesh? Parametric surfaces? Voxels?

  4. #4
    Intern Contributor
    Join Date
    Feb 2013
    Posts
    75
    I think I found a solution while googling it up.

    http://paulbourke.net/papers/conrec/


    What do you think ?

  5. #5
    Intern Contributor
    Join Date
    Feb 2013
    Posts
    75
    so far started with the triangular mesh.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,411
    Quote Originally Posted by sajis997 View Post
    I think I found a solution while googling it up.
    Personally, I'd be inclined to do it via rasterisation rather than geometrically.

    Essentially the same thing as glTexGen() in GL_OBJECT_LINEAR mode, but using a shader to avoid thickening of the contour lines on near-perpendicular surfaces.

  7. #7
    Intern Contributor
    Join Date
    Feb 2013
    Posts
    75
    Any example opengl code you could refer me to ?

  8. #8
    Member Regular Contributor
    Join Date
    Mar 2015
    Posts
    296
    from math, you should use a series of planes with equal distance to cut the 3D model, get their crossover points, then connect them, you will get the contour.

  9. #9
    Member Regular Contributor
    Join Date
    Mar 2015
    Posts
    296
    if you have the model, you can discharge the z value, enough.

  10. #10
    Intern Newbie
    Join Date
    May 2015
    Posts
    37
    There`s a simpler alternative.
    Draw your model on a clear Z-buffer and save the resulting Z-buffer to a texture. You now have a depth mask of your model.
    Now load it into a pixel shader and calculate the contour using dilation from mathematical morphology.

Posting Permissions

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