done by can
logo done by can :: pouët.net is hosted on the huge scene.org servers




3D Meshes and CSG operations
category: code
go to page of 1  
How to realize CSG operations in 3D mesh objects? Please, discuss the principles.
added on the 2011-02-24 16:15:59 by Danguafer  
Danguafer
Depends.exe on what you are doing.
3D mesh objects as in triangle meshes? I guess there are tons of papers on that topic and a lot of different approaches... google it.
Or just take distance fields instead - in distance fields CSG is trivial ;)
added on the 2011-02-24 16:52:25 by las  
las
Clip the triangles against each other, check inside/outside rules for each resulting polygon. Simple in theory, but turns into absolute hell in reality due to floating point accuracy. There's a reason why there's very few CSG-packages out there that can eat it's own dog-food.
added on the 2011-02-24 17:04:16 by kusma  
kusma
Maybe an easier place to start: Screen Space CSG?
added on the 2011-02-24 17:50:45 by revival  
revival
OpenCSG uses some image-based method.
added on the 2011-02-24 17:54:08 by eyebex  
eyebex
Indeed, screen-space CSG is much easier to get robust.
added on the 2011-02-24 17:57:50 by kusma  
kusma
This reminds me.. I wonder if anyone ever made a .pov ---> random-polygon-object-format converter, e.g. something that would eat povray's script (even with limited set of primites) and output an approximation as a mesh.
added on the 2011-02-24 20:45:39 by uncle-x  
uncle-x
Just a first random pick... http://www.nigels.com/research/ there's really a huge amount of academic research out there...
Or if you wanna just cut out planes, you have it nearly for free in OpenGL, see for instance http://www.cs.duke.edu/courses/fall00/cps124/web/links.html.
Hmm, distance functions are lovely...
must... download... framework... and play!
added on the 2011-02-24 21:36:18 by bdk  
bdk
The easiest one to implement is:

http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node11. html
added on the 2011-02-25 11:19:04 by rasmus/loonies  
rasmus/loonies
Easy peasy. Intersect all edges of mesh A with triangles of mesh B and vice versa. Then just connect the dots :)

Bonus points doing the intersection stuff so that each pair or triangles intersect at either 0 or 2 points, retriangulating without nasty singularities and getting intuitive results on non-perfect input meshes.
added on the 2011-02-25 15:03:16 by 216  
216
bsp trees will help you with csg:

A Tutorial on Binary Space Partitioning Trees
BSP FAQ
flipcode article

also there's example code in Game Programming Gems 5, if you need it, I'll send you the source code
added on the 2011-02-27 18:17:44 by Ized  
Ized
Weeks struggling for a stable connection...
Thanks for the answers.

Ized: Would you mail me it? dang...@gmail.com
added on the 2011-03-11 22:51:36 by Danguafer  
Danguafer
http://www.opengl.org/resources/code/samples/advanced/advanced97/programs/csg.c
added on the 2011-03-16 16:31:19 by bdk  
bdk
with something resembling to an authority, i can confirm that you really don't want to code triangle-mesh CSG yourself. However, if you still insist to do it, I can recommend 216's method above :)
added on the 2011-03-16 21:47:53 by blala  
blala
I need it and I want it. D:
added on the 2011-03-16 22:41:06 by Danguafer  
Danguafer
go to page of 1  

post a new reply
You need to be logged in to post a new reply :: register here





pouët.net 0.9-b83ba26 © 2000-2013 mandarine - hosted on scene.org
send comments and bug reports to webmaster@pouet.net - contribute on GitHub
page created in 0.020131 seconds.