Fast Minimum Storage Ray/Triangle Intersection

https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf

we present a clean algorithm for determining whether a ray intersects a triangle. the algorithm translates the origin of the ray and then changes the base of that vector which yields a vector 在这里插入图片描述
where t is the distacen to the plane in which the triangle lies and (u,v) represents the coordinates inside the triangle.

one advantage of this method is that the plane equation need not be computed on the fly nor be stored, which can amount to significant memory savings for triangle meshes. as we found our method to be comparable in speed to previous methods, we believe it is the fastest ray/triangle intersection routine for triangles which do not have precomputed plane equations.

keywords: ray tracing, intersection, ray/triangle-intersection, base transformation.

1 introduction

a ray R(t) with origin O and normalized direction D is defined as
在这里插入图片描述
and a triangle is defined by three vertices Vo, V1, and V2. In the ray/triangle intersection problem we want to determine if the ray intersects the triangle. Previous algorithms have solved this by first computing the intersection between the ray and the plane in which the triangle lies and then testing if the intersection
point is inside the edges.

our algorithm uses minimal storage (i.e only the vertices of the triangle need to be stored) and does not need any preprocessing. For triangle meshes, the memory savings are significant ranging from about 25% to 50% depending on the amount of vertex sharing.

in our algorithm, a transformation is constructed and applied to the origin of the ray. the transfomation yields a vector containing the distance, t, to the intersection and the coordinates, (u,v), of the intersection.

2 intersection algorithm

a point, T(u,v), on a triangle is given by
在这里插入图片描述

where (u,v) are the barycentric coordinates, which must fulfill u>=0, v>=0 and u+v<=1.
note that (u,v) can be used for texture mapping, normal interpolation, color interpolation etc. computing the intersection between the ray, R(t), and the triangle, T(u,v), is equivalent to R(t) = T(u,v), which yields:
在这里插入图片描述
这个交点,既在平面上,又在射线上。所以满足上面的方程。

rearranging the terms gives:
在这里插入图片描述
D是单位化之后的射线的方向
O是射线的起点(原点)
V0/V1/V2是三角形的三个顶点

this means the barycentric coordinates (u,v) and the distance, t, from the ray origin to the intersection point can be found by solving the linear system of equations above.

the above can be thought of geometrically as translating the triangle to the origin, and translating it to t a unit triangle in y&z with the ray direction aligned with x, as illustrated in figure 1 (where M=[-D, V1-V0, V2-V0] is the matrix in equation 4).

在这里插入图片描述
figure 1: translation and change of base of the ray origin

Arenberg describes a similar algorithm to the one above. he also constructs a 3x3 matrix but uses the normal of the triangle instead of the ray direction D. this method requires storing the normal for each triangle or computing them on the fly.
这个方向需要存储三角形的法线,或者是在运行时计算。

denoting E1=V1-V0, E2=V2-V0 and T=O-V0, the solution to equation (4) is obtained by using Cramer’s rule:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值