I have an OpenGL Tessellated Sphere and I want to cut a cylindrical hole in it

前端 未结 3 2062
野趣味
野趣味 2020-11-29 14:12

I am working on a piece of software which generated a polygon mesh to represent a sphere, and I want to cut a hole through the sphere. This polygon mesh is only an overlay a

3条回答
  •  伪装坚强ぢ
    2020-11-29 14:41

    I implemented CSG operations using scalar fields earlier this year. It works well if performance isn't important. That is, the calculations aren't real time. The problem is that the derivative isn't defined everywhere, so you can forget about computing cheap vertex-normals that way. It has to be done as a post-step. See here for the paper I used (in the first answer), and some screenshots I made:

    CSG operations on implicit surfaces with marching cubes

    Also, CSG this way requires the initial mesh to be represented using implicit surfaces. While any geometric mesh can be split into planes, it wouldn't give good results. So spheres would have to be represented by a radius and an origin, and cylinders would be represented by a radius, origin and base height.

提交回复
热议问题