在 OpenGL 中使用四面体对可变形对象进行建模
我想在 OpenGL 中渲染由四面体组成的网格,因为我正在尝试实现需要使用“有限元方法”的动画。作为 OpenGL 的新手,我不太确定如何解决这个问题。
到目前为止,我遇到了 NETGEN ,它应该从对象生成四面体网格。从我下载的示例中,它需要一个 .geo 文件作为输入并输出一个 .vol 文件。
.vol 文件内列出了许多数据点和变量。这是要读入的标准文件吗?或者它是否是专有的,具体取决于生成它的软件?换句话说,是否有渲染此类文件的标准方法,或者我是否需要手动解析文件中的数据,然后以某种方式将其渲染为 GL_LINES 等?
I want to render a mesh made up of tetrahedron in OpenGL because I am trying to implement animation which requires the use of the 'finite element method'. As a novice of OpenGL, I am not quite sure how to approach this.
So far, I have come across NETGEN which is supposed to generate a tetrahedral mesh from an object. From the example I downloaded, it takes a .geo file for input and outputs a .vol file.
The .vol file has a lot of data points and variables listed inside. Is this a standard file to read in? Or is it proprietary depending on which software generates it? In other words, are there standard methods for rendering this kind of file or do I need to manually parse the data from the file and then somehow render it as GL_LINES, etc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
名称后缀绝对是无意义的。
无论如何,OpenGL 只提供绘图工具。没有读取文件的功能,无论是几何图形还是图像。因此不存在“标准 OpenGL 文件格式”。
事实上,您需要使用您编写的解析器或某些第三方库来读取这些文件,并将数据传递给 OpenGL,然后发出正确的命令以使 OpenGL 从数据中绘制图片。
The name suffixes are absolutely nontelling.
Anyway, OpenGL deals with providing drawing tools only. There's no functionality to read in files, be it geometry or images. And thus there is no "standard OpenGL file format".
Indeed it's your deed to read in those files, either with a parser you write, or some third party library, and pass the data to OpenGL, then issuing the right commands to make OpenGL draw a picture from the data.