Free Hand 3D Crop..

Discussion in 'Beginners Zone' started by vindos, May 22, 2008.

  1. vindos

    Newcomer

    Joined:
    Nov 1, 2005
    Messages:
    64
    Likes Received:
    0
    Hello Guys..

    I need advise on how to go about implemneting free hand crop... My req is i will have a 3d object rendered to the screen.. and user can crop any part of the 3d object and create hollows by free hand ..Am using opengl.

    Thankss
     
  2. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    16,560
    Likes Received:
    3,875
  3. zsouthboy

    Regular

    Joined:
    Aug 1, 2003
    Messages:
    563
    Likes Received:
    9
    Location:
    Derry, NH
    Your description of what you want doesn't sounds like anything in Blender to me (heavy blender user.).

    Can you perhaps post a picture illustrating what you want to do? I can't tell what you want to do, exactly :/.
     
  4. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    16,560
    Likes Received:
    3,875
    sounds like he wants to remove material from a solid
     
  5. vindos

    Newcomer

    Joined:
    Nov 1, 2005
    Messages:
    64
    Likes Received:
    0
    yess...my requiremnt is to extract material from a 3d object that i render.
    Using mouse user can draw any closed shape , over my rendered 3d image and i have to remove the material inside the closed shape...
    User can extract any part of the 3d object by rotating it and drawing closed figures on its surface
     
  6. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    16,560
    Likes Received:
    3,875
    other than my original answer i cant help you much
    even if someone heres knows how to do it i suspect the answer to be several pages long and i cant imagine anyone taking the time.
     
  7. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Do you require a geometric solution, or just a visual one? If the latter you can use the stencil buffer to extract the area that the crop volume cuts out of the model.
     
  8. sebbbi

    Veteran

    Joined:
    Nov 14, 2007
    Messages:
    2,924
    Likes Received:
    5,293
    Location:
    Helsinki, Finland
    Link to a article describing how to do this with the stencil buffer trick:
    http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node11.html

    If you need a real geometric solution and not just a visual one, you need to implement geometry CSG substraction. This is a pretty complex issue to describe here in the boards.

    A simple method:
    Object A = your original object (must be a closed single surface volume)
    Object B = the clipping object (must be a closed single surface volume)
    1. Go though all object A faces (triangular polygons). For each face check which object B faces are intersecting it.
    1.1. Split the object A face by the plane of the object B face (the original face is replaced with 2 faces). For all the later intersection tests use the new splitted faces instead of the original face.
    2. Go though all object A faces, and remove the faces with center point inside the object B mesh.
    2.1. One way to detect if a point is inside mesh is to cast a ray to any direction. If the ray closest intersection is to the backside of a face, then the point it inside. If the intersection is to the frontside of a face or there is no intersection, then the point is outside.
    3. Now your object A is processed and ready.
    4. Split all object B intersecting faces with object A faces like described in step 1. Use the original object A in this case, not the processed one.
    5. Go though all object B faces, and remove the faces with center point OUTSIDE the object B mesh. Use the same point inside/outside test you already implemented for the step 2.
    6. Flip the faces of object B.
    7. Now your object B is processed and ready.
    8. Add both processed object faces together to one single mesh.
     
  9. vindos

    Newcomer

    Joined:
    Nov 1, 2005
    Messages:
    64
    Likes Received:
    0
    Thanks everybody for the replies :)
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...