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

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

问题描述

我正在开发一款生成多边形网格来表示球体的软件,我想在球体上切一个洞.这个多边形网格只是球体表面的一个叠加层.我很清楚如何确定哪些多边形将与我的洞相交,我可以将它们从我的收藏中删除,但在那之后我有点困惑.我想知道是否有人可以帮助我了解高级概念?

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. 

对于#1,我可以对此进行测试(没有移除多边形)并采取相应的行动(什么都不做).对于#2 和#3,我不知道如何重新细分我的球体以解释这个洞.对于#3,我有一些基本的想法:

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. 

这个极其简化的算法有一些我想填充的洞".例如,我实际上并不希望我的洞有 4 个边——它应该是一个圆柱体,或者至少是一个曲面的细分表示圆筒.我也不知道如何制作这些新的多边形来让我的球体在镶嵌的表面上有一个洞.

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.

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

I have no idea how to approach scenario #2.

推荐答案

听起来像您想要的 构造立体几何.

Carve 可能会满足您的需求.如果您只想要运行时渲染,OpenCSG 会起作用.

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

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

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