CSG Modeling in OpenGL

前端 未结 2 1136
迷失自我
迷失自我 2021-01-28 15:19

I am dealing with Constructive Solid Geometry(CSG) modeling with OpenGL.

I want to know how to implement binary operation. I read something about Gold Feather Algori

相关标签:
2条回答
  • 2021-01-28 15:43

    OpenGL will not help you. OpenGL is a rendering library/API. It draws points, lines and triangles; it's up to you to tell it what to draw. OpenGL does not maintain a scene or even has a notion of coherent geometric objects. Hence CSG is not something that goes into OpenGL.

    0 讨论(0)
  • 2021-01-28 15:58

    Nicol Bolas is correct - OpenGL will not help with CSG, it only provides a way to draw 3D things onto a 2D screen. OpenCSG is essentially "fake" CSG by using using OpenGL's depthbuffers, stencils and shaders to make it appear that 3D objects have had a boolean operation performed on them.

    CSG is a huge task and I doubt you will ever find an "algorithm easy to understand" Have a look at this project: http://code.google.com/p/carve/ which performs CSG on the triangles/faces which you would then draw to OpenGL

    0 讨论(0)
提交回复
热议问题