[英]How to get 3D coordinates of a triangle on a Geodesic Dome using Python?
I want to generate a Geodesic Dome (sphere) with triangles using the panda3d engine. 我想使用panda3d引擎生成带有三角形的Geodesic Dome(球形)。 I have searched in python for a function to position my all triangles in 3d world (x,y and z) and rotation to create the sphere.
我在python中搜索了将我的所有三角形定位在3d世界(x,y和z)中并旋转以创建球体的函数。
For rotation i use function setHpr(0,0,0) H for heading p for pitch r for roll 对于旋转,我使用函数setHpr(0,0,0)H表示航向p表示俯仰r表示滚动
I have search for a mathematical function to replace my 0 values in: 我正在寻找一个数学函数来替换我的0值:
class Triangle(GeometricObject):
def __init__(self, x, y, z, h, p, r):
self.x = x
self.y = y
self.z = z
self.x = h
self.y = p
self.z = r
Triangle_List=[]
for i in range(0,2000):
mytriangle=Triangle(0, 0, 0, 0, 0, 0)
Triangle_List.append(mytriangle)
How can I transform the Triangle(0, 0, 0, 0, 0, 0) coordinates to the required values ? 如何将Triangle(0,0,0,0,0,0)坐标转换为所需值? Thanks in advance.
提前致谢。
The concepts to subdivide the faces and project to new points are described in the blog designing a geodesic house (part 1) . 在设计大地测量房屋的博客(第1部分)中描述了将面孔细分并投影到新点的概念。 A more thorough treatment is the book Geodesic Math and How to Use It by Hugh Kenner 1976.
更全面的方法是Hugh Kenner 1976年出版的《 大地测量数学和使用方法》一书。
PyDome will provide the coordinates for many types of geodesic dome configurations. PyDome将提供许多类型的测地线穹顶配置的坐标。 Python Code on GitHub.
GitHub上的Python 代码 。
Rick Bono's DOME Program written in C++ has extensive documentation and features. Rick Bono的C ++编写的DOME程序具有广泛的文档和功能。
Acid Dome is one online calculator that provides the templates for edges and faces, but not the coordinates. Acid Dome是一个在线计算器,提供边缘和面的模板,但不提供坐标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.