5D raytracing implementation
6 次查看(过去 30 天)
显示 更早的评论
Hi all...
I'm fairly new to matlab so I'm looking for some guidance on implementation of an algorithm for doing simple raytracing... here's some pseudo code of what I'm trying to accomplish....
I have a 5D array L... the first 4 dims are pairs of coordinates... the 5th is a color/intensity index... I want to intersect a ray for each pixel of the image plane(RF) with the other two polygons(s,t,u,v) to get a color index (c)...
a ray r = (s, t, u, v) has a color c(r) = c(s, t, u, v). Likewise, a pixel (x, y) in the desired image has a color c(x, y). Let K be the desired camera with a center of projection o and pixels (x, y) on its image plane. w(x, y) is an aperture weighting function , where aw is the width of the aperture.
C is the camera plane(s,t)
F is the focal plane (f,g)
r(s,t,u,v) == r(s,t,f,g)F
%RC := a polygon on C defined by {(s ± aw/2, t ± aw/2)}
%RK := projection of RC onto the desired image plane
%For each pixel (x, y) within RK
%r := the ray through o and (x, y)
%Intersect r with C and F to get (s, t) and (f, g)F
%(u, v) := MF→D s,t (f,g)F
%weight := w(s − s, t − t)
%c(x, y) := c(x, y) + weight ∗ c(s, t, u, v)
can anyone provide any insight?
/r
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Propagation and Channel Models 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!