【发布时间】:2023-03-30 08:15:01
【问题描述】:
我在 cgal 中编写了一个带有树加速的小型光线追踪器(使用 CGAL::Surface_mesh Mesh)。我想找到一个命中原语的所有邻居。
Ray_intersection hit = tree.first_intersection(rays[y][x]);
if(hit)
{
const Point& point = boost::get<Point>(hit->first);
const Primitive_id& primitive_id = boost::get<Primitive_id>(hit->second);
//i need the neighbours of the hit primitive
}
我该怎么做?我找到了这个文档,但它似乎只适用于点而不是原语:
https://doc.cgal.org/latest/Spatial_searching/index.html
它搜索它的欧几里得距离而不是连接在一起。
有没有类似的东西:
std::vector<Primitive_id&> ids = getNeighoursOfPrimive(primitive_id);
就像我说的,我使用 CGAL::Surface_mesh Mesh 作为我的网格,它们只是场景中的一个网格。
【问题讨论】:
标签: c++ cgal raytracing