我有一个OpenGL Tessellated Sphere,我想在它上面切一个圆柱形孔 [英] I have an OpenGL Tessellated Sphere and I want to cut a cylindrical hole in it

查看:198
本文介绍了我有一个OpenGL Tessellated Sphere,我想在它上面切一个圆柱形孔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个软件,它生成一个多边形网格来表示一个球体,并且我想在球体上切出一个洞。这个多边形网格只是整个球体表面的一个覆盖层。我对如何确定哪些多边形会与我的洞相交有一个很好的想法,并且可以将它们从我的集合中删除,但在此之后,我有点困惑。我想知道是否有人可以帮助我的高级概念?基本上,我设想了三种情况:


pre> 1。)圆柱形孔不与我的球体相交。
2.)圆柱形孔部分穿过我的球体。
3.)圆柱形孔一直贯穿我的球体。

对于#1,我可以测试它(不删除多边形)并相应地执行操作。对于#2和#3,我不知道如何重新镶嵌我的球体来解决这个问题。对于#3,我基本上有以下几点想法:

  a。)找到你的入口点)找到你的出口点(一个圆)
c。)删除必要的多边形
d。)沿着孔的4 *边创建新的多边形,保持我的
球形是多方面的。

这个非常简单的算法有一些我想填写的'漏洞'。例如,实际上我不想让自己的四条边到我的洞 - 它应该是一个圆柱体,或者至少是一个圆柱体的镶嵌表示。我也不确定如何让这些新的多边形保持我的球体在棋盘格表面留下一个洞。



我不知道如何处理场景#2。

解决方案

听起来像你想具有建设性的立体几何



雕刻可能会做你想做的。如果您只想运行时呈现 OpenCSG ,则可以使用。


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 across the surface of the sphere. I have a good idea of how to determine which polygons will intersect my hole, and I can remove them from my collection, but after that point I am getting a little confused. I was wondering if anyone could help me with the high-level concepts?

Basically, I envision three situations:

1.) The cylindrical hole does not intersect my sphere.
2.) The cylindrical hole partially goes through my sphere.
3.) The cylindrical hole goes all the way through my sphere. 

For #1, I can test for this (no polygons removed) and act accordingly (do nothing). For #2 and #3, I am not sure how to re-tessellate my sphere to account for the hole. For #3, I have somewhat of an idea that is basically along the following lines:

a.) Find your entry point (a circle)
b.) Find your exit point (a circle) 
c.) Remove the necessary polygons
d.) Make new polygons along the 4* 'sides' of the hole to keep my 
    sphere a manifold. 

This extremely simplified algorithm has some 'holes' I would like to fill in. For example, I don't actually want to have 4 sides to my hole - it should be a cylinder, or at lease a tessellated representation of a cylinder. I'm also not sure how to make these new polygons to keep my sphere with a hole in a tessellated surface.

I have no idea how to approach scenario #2.

解决方案

Sounds like you want constructive solid geometry.

Carve might do what you want. If you just want run-time rendering OpenCSG will work.

这篇关于我有一个OpenGL Tessellated Sphere,我想在它上面切一个圆柱形孔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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