在OpenGL中进行CSG建模 [英] CSG Modeling in OpenGL

查看:804
本文介绍了在OpenGL中进行CSG建模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用OpenGL处理​​构造实体几何(CSG)建模。



我想知道如何实现二元运算。我读了一些关于 Gold Feather Algorithm 的文章,并且我知道 OpenCSG a>但是在阅读其源代码后,我发现它太复杂了。我只需要一个简单的最短的OpenGL例子来实现它。



在算法中没有限制,只要它易于实现。

解决方案
OpenCSG本质上是虚假的CSG,通过使用OpenGL的深度缓冲区,模板和着色器使它显现出来,以便3D对象对它们执行布尔操作。



CSG是一项艰巨的任务,我怀疑你会找到一种易于理解的算法
看看这个项目: http://code.google.com/p/carve/ ,它将在三角形/面上执行CSG,然后您将绘制到OpenGL上


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 Algorithm and I know about OpenCSG but after reading its source code, I found it too complicated to understand. I just need a simple shortest OpenGL example how to implement it.

There's no restrict in Algorithm as long as it is easy to implement.

解决方案

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

这篇关于在OpenGL中进行CSG建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆