雷体素交叉口 [英] Ray voxel intersection

查看:124
本文介绍了雷体素交叉口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要测试与体素场射线的交集。

I want to test for an intersection of a ray with a voxel field.

我天真地通过像素领域通过计算与射线盒路口抓取当前体素的边缘,然后做同样为下一个像素,直到我碰到了什么东西。但是,是不是有通过体素实地跟踪一个更快的方法?我沿着3D 布雷森汉姆直线算法,东西线,可以很快给我所有的细胞思维的东西一个给定的线相交。任何人都这样做过?

I could naively crawl through the voxel field by calculating a ray-box intersection with the edge of the current voxel, then doing the same for the next voxel until I hit something. But isn't there a faster way to trace through a voxel field? I was thinking something along the lines of Bresenham's line algorithm in 3D, something that could quickly give me all of the cells a given line intersects. Anyone done this before?

由于certian限制和事实上这些射线痕迹都没有发生,往往,我不希望建立一个八叉树或任何其他数据结构。

Due to certian limitations and the fact that these ray traces aren't happening that often, I do not want to build an octree or any other data structure.

推荐答案

这里的布氏在3D的实现。这是在MATLAB;如果你不说话,你可以在这里看到一个 C实现

Here's an implementation of Bresenham's in 3D. It's in matlab; if you don't speak that you can see a C implementation here.

这篇关于雷体素交叉口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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