用于三角交叉加速结构的简单C / C ++库 [英] Simple C/C++ library for triangle-intersection acceleration structure

查看:160
本文介绍了用于三角交叉加速结构的简单C / C ++库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是光线追踪者,并且想通过某种加速结构(kd-tree,BVH,无论如何)加速它。我不想自己编写代码。我到目前为止所尝试过的:




  • 用pbrt代替kd-tree。有很多内部依赖关系,如果不将全部pbrt拉入我的代码,我都无法成功。

  • 令人沮丧的是,这似乎只会返回交点。不知道点来自哪个三角形,我无法在三角形上高效地插入颜色。我很想用颜色来扩展Point的概念,但是如果不从头开始编写大量的模板代码,这似乎是不可能的。

    >写我自己的。好吧,我写了自己的网格加速类,它可以工作,但它很讨厌,效率低下。 因此,如果任何人都可以推荐一个简单的库,我可以用它来达到这个目的,我真的很感激它!所有我需要的是一个三角形的汤和射线,找到最接近的交点,并返回该三角形的索引。

    解决方案

Jaco Bikker写下这一系列的教程: http://www.devmaster.net/articles/raytracing_series/ part7.php



他们非常有帮助,他在最后包含了使用kd-tree的光线跟踪器的代码。



您也许可以使用它。


I'm raytracing and would like to speed it up via some acceleration structure (kd-tree, BVH, whatever). I don't want to code it up myself. What I've tried so far:

  • Yanking the kd-tree out of pbrt. There are so many intra-dependencies that I couldn't succeed at this without pulling all of pbrt into my code.

  • CGAL's AABB tree. Frustratingly, this seems to return only the point of intersection. Without knowing which triangle the point came from, I can't efficiently interpolate color over the triangle. I'd love to just extend the notion of "Point" with color, but this doesn't seem possible without writing a lot of template code from scratch.

  • Writing my own. Okay so I wrote my own grid acceleration class, and it works, but it's nasty and inefficient.

So, if anyone can suggest a simple library that I can use for this purpose I'd really appreciate it! All I need is given a triangle soup and ray, find the closest intersection and return the index of that triangle.

解决方案

Jaco Bikker wrote this series of tutorials: http://www.devmaster.net/articles/raytracing_series/part7.php

They're very helpful and he includes code at the end for a ray tracer using a kd-tree.

You might be able to use that.

这篇关于用于三角交叉加速结构的简单C / C ++库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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