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!