Free Hand 3D Crop..

vindos

Newcomer
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
 
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 :/.
 
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
 
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.
 
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.
 
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.
 
Back
Top