Skip to main content
GameDev.net gamedev.net
🔒 Locked

Real-Time Digital Sculpting

Started by ouraqt Mar 1, 2010 at 1:01 AM 1 replies 1.5k views
Original Post
ouraqt
ouraqt
I'm working on an application that will allow users to digitally sculpt into a triangle mesh. Rendering is done in OpenGL. The basic concept is that users can sculpt into a mesh with a pillbox-shaped tool (a pillbox is a cylinder with half-spheres at the ends - it can also be thought of as a line segment with thickness radius r). The way the user moves this virtual tool around in space is irrelevant. But any time the tool intersects with the mesh, it should basically "subtract" away that intersecting portion. What is the best way to do this? My first approach was to simply move the vertices until they are no longer intersecting the mesh, but this doesn't account for when the tool goes all the way through the mesh to make a "hole" in the solid. How do I handle this? I was thinking of some method that never moves vertices around, but instead deletes the intersecting triangles/vertices and generates new ones around the boundary region. Is this a good approach? Thanks!
Hodgman
Hodgman
I'd get a copy of ZBrush and make careful observations of what happens to the verts when you perform these operations in their tool ;)

A simpler approach might be to perform the sculpting on voxel data structure and render using verts/triangles.
PolyVox
PolyVox
As Hodgman says, voxels could be a good solution for this kind of problem. I have an Open Source library for handling their representation and conversion to triangles, and it was recently used to create a 'Dental Surgery Simulator' which seems like a similar application to what you are presenting.

Alternatively, you can try to operate on the raw triangle data. This is non-trivial but 'Constructive Solid Geometry' is the term to search Google for. You can also try faking the effect in image space using something like OpenCSG

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.