ray tracing a bezier surface (please help)

Started by
0 comments, last by phantomus 17 years, 6 months ago
I've run into a brickwall with a bezier surface ray intersection algorithm. Usually what I did with a b-spline curve was to subdivide it into lines at certain U points in the curve, then subdivide that section further to find a more exact intersection point. No matter what the direction of the ray it will always lie inside the further subdivided U section of the curve. Here are some samples: Subdivision level 1 Subdivision level 2 This method works fine. However, as I noticed when moving to surfaces (I'm using bezier patches now instead of b-spline patches) and subdividing the surface into planes, I run into some problems. In this first case, the method works fine since the line is almost perpendicular to the surface and is almost guaranteed to lie inside a chosen U,V section: Subdivision level 1 Subdivision level 2 Subdivision level 3 In the second case this won't work since the ray is too slanted and it will first intersect inside the first quadrant and then intersect on the next one, essentially ruining the algorithm: Subdivision level 1 Subdivision level 2 The only way to solve this would be to check again with the next level of subdivision on the whole surface again every time the ray is "lost", but this essentially takes away the efficiency of the algorithm and would make it too slow. Is there a way to circumscribe the ray to a U,V section to an infinite degree of precision?
Advertisement
Carsten Benthin wrote a thesis on the OpenRT ray tracer and reserved quite a few pages for bezier surfaces. Check it out:

http://graphics.cs.uni-sb.de/~benthin/final.pdf

Greets
Jacco.

This topic is closed to new replies.

Advertisement