Friday, November 17, 2006

Ray tracing bilinear patches

I'm going to try to reimplement the displacement map method I did with Brian Smits and Mike Stark a few years ago. A key part of that method is intersecting bilinear patches. Given a ray o+tv and a patch with vertices p00, p01, p11, and p10 we have

o + tv = (1-u)(1-v)p00 + u(1-v)p10 + (1-u)v p01 + uv p11

This is three equations (x, y, and z) and three unknowns (t, u, v). The way Brian and I solved this was to eliminate t by using 2 of the equations and then solve the uv system directly. A similar approach is used in Shaun Ramsey et al.'s jgt paper. This has always been unsatisfactory to me because it chooses an arbitrary ordering of the dimensions. Perhaps a numeric solution would be more robust?

Another possibility is to use Kajiya's old trick. Consider the ray as the intersection of two planes

(p - p0) dot N0 = 0
(p - p1) dot N1 = 0

If you substitute
p = (1-u)(1-v)p00 + u(1-v)p10 + (1-u)v p01 + uv p11

into both the plane equations above then you get two equations in uv of the form:
Auv + Bu + Cv + D = 0 (1)
auv + bu + cv + d = 0 (2)

If you solve one of those for u and then plug it into the other, you get a quadratic in v. That leaves four possibilities of what to do first:

solve (1) for u
solve (1) for v
solve (2) for u
solve (2) for v

There is also a degree of freedom for which planes to use. In any case seems more stable than the three equations, 2 unknowns method above.

2 comments:

sexy said...

情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣,情趣,情趣,情趣,情趣,情趣,情趣,情趣,A片,視訊聊天室,聊天室,視訊,視訊聊天室,080苗栗人聊天室,上班族聊天室,成人聊天室,中部人聊天室,一夜情聊天室,情色聊天室,視訊交友網a片,a片


免費A片,AV女優,美女視訊,情色交友,免費AV,色情網站,辣妹視訊,美女交友,色情影片,成人影片,成人網站,A片,H漫,18成人,成人圖片,成人漫畫,情色網,日本A片,免費A片下載,性愛

A片,色情,成人,做愛,情色文學,A片下載,色情遊戲,色情影片,色情聊天室,情色電影,免費視訊,免費視訊聊天,免費視訊聊天室,一葉情貼圖片區,情色,情色視訊,免費成人影片,視訊交友,視訊聊天,視訊聊天室,言情小說,愛情小說,AIO,AV片,A漫,avdvd,聊天室,自拍,情色論壇,視訊美女,AV成人網,色情A片,SEX,成人論壇

情趣用品,A片,免費A片,AV女優,美女視訊,情色交友,色情網站,免費AV,辣妹視訊,美女交友,色情影片,成人網站,H漫,18成人,成人圖片,成人漫畫,成人影片,情色網


情趣用品,A片,免費A片,日本A片,A片下載,線上A片,成人電影,嘟嘟成人網,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,微風成人區,成人文章,成人影城,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,臺灣情色網,色情,情色電影,色情遊戲,嘟嘟情人色網,麗的色遊戲,情色論壇,色情網站,一葉情貼圖片區,做愛,性愛,美女視訊,辣妹視訊,視訊聊天室,視訊交友網,免費視訊聊天,美女交友,做愛影片

av,情趣用品,a片,成人電影,微風成人,嘟嘟成人網,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,成人文章,成人影城,愛情公寓,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,色情,寄情築園小遊戲,情色電影,aio,av女優,AV,免費A片,日本a片,美女視訊,辣妹視訊,聊天室,美女交友,成人光碟

情趣用品.A片,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,色情,寄情築園小遊戲,情色電影,色情遊戲,色情網站,聊天室,ut聊天室,豆豆聊天室,美女視訊,辣妹視訊,視訊聊天室,視訊交友網,免費視訊聊天,免費A片,日本a片,a片下載,線上a片,av女優,av,成人電影,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,成人文章,成人影城,成人網站,自拍,尋夢園聊天室

Namek said...

Hi! Is there on the Internet any implementation of that displacement mapped triangle traversal method? I was searching whole day and didn't found anything workable.

I tried to implement that method but it seems that the loop cannot find intersect point and is going forever in a circle.