Jump to content


Costa

Member Since 25 Jan 2013
Offline Last Active Feb 01 2013 05:32 PM
-----

Topics I've Started

Some Ray Tracing questions

25 January 2013 - 08:42 PM

Hi, im currently working in a very simple C implementation of a Ray Tracer; basically all I have to do is, given a set of triangles and a ray, find out where is the intersection point if it exists. I have some questions regarding the design and handling of some stuff (I'm gonna use a kd-tree to manage the tracing):

1) What is a good way to store the triangles? I made a "Point" structure to store the x, y, z coordinates of a point. Would a Point vector be a good idea?
2) What should the kd-tree structure contain? I've read some papers and that could be the set of triangles (and maybe the quantity), the bounding box, the left and right nodes, maybe a leaf flag, maybe some depth indicator. Am I missing anything?

Thanks in advance.