使用 kd 树进行斯坦福兔子模型的光线追踪
我正在尝试对 PLY 格式的斯坦福兔子模型进行光线追踪。我有一个解析器,它解析 PLY 文件并给出三角形及其顶点的坐标值。现在我很困惑如何继续前进。我应该将这些三角形顶点放入向量中,然后传递它们来构建 kd 树吗?是否有人有教程或示例源代码,其中将层模型传递到 kd 树,然后遍历 kd 树以对场景进行光线追踪?如果有人有可以分享的示例代码,请告诉我。谢谢。
I am trying to ray trace the Stanford bunny model which is PLY format. I have a parser which parses the PLY file and gives me the value of co-ordinates of triangles and also their vertices. Now I am confused as to how to proceed ahead. Should I put these triangle vertices in a vector and then pass them to build a k-d tree? Also does someone have a tutorial or a sample source code where a ply model is passed to the k-d tree and the k-d tree is then traversed to ray trace the scene? If anybody has a sample code which they can share, pls let me know. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PLY 是一种描述为多边形集合的对象的文件格式。 KD 树是一种优化结构,旨在通过消除不必要的相交测试来加快渲染时间。
因此,您需要:
使用 google 查找 KD 树的更多信息和示例代码。标准论文由 Vlastimil Havran 撰写,可在线获取。
PLY is a file format for objects described as a collection of polygons. A KD Tree is an optimisation structure designed to speed up rendering times by eliminating unnecessary intersection tests.
So you need to:
Use google to find more info and sample code for KD Trees. The standard paper is by Vlastimil Havran which is available on-line.