drumminj

03-29-2000, 10:41 AM

I'm not sure if this is an advanced topic or not. If not, I apologize. Anyways, here's my question/problem:

I need to raytrace a surface of revolution(a spline revolved around the z-axis). In order to do this I've created a polygon mesh representation of the surface and stored the polygons in a list.

The part I'm not sure of is how to calculate the intersetion of rays with the mesh. My initial thoughts on it are to loop through the list of polygons and check to see if N dot V is negative(N = normal of polygon, V = ray sent out from camera). If so, it is a front-facing polygon. I can then keep track of the polygon closest to the camera that is front-facing. I believe this will work, but perhaps there's a better/more efficient way???

Secondly, how can I test for intersection between the ray and the polygon? Using the method described above, I only get the closest, front-facing polygon. But how to I test if the ray intersects this polygon?

as always, all help appreciated.

J

I need to raytrace a surface of revolution(a spline revolved around the z-axis). In order to do this I've created a polygon mesh representation of the surface and stored the polygons in a list.

The part I'm not sure of is how to calculate the intersetion of rays with the mesh. My initial thoughts on it are to loop through the list of polygons and check to see if N dot V is negative(N = normal of polygon, V = ray sent out from camera). If so, it is a front-facing polygon. I can then keep track of the polygon closest to the camera that is front-facing. I believe this will work, but perhaps there's a better/more efficient way???

Secondly, how can I test for intersection between the ray and the polygon? Using the method described above, I only get the closest, front-facing polygon. But how to I test if the ray intersects this polygon?

as always, all help appreciated.

J