I am trying to ray trace the Stanford bunny model which is PLY format. I have a parser which parses the PLY file and gives me the value of co-ordinates of triangles and also their vertices. Now I am confused as to how to proceed ahead. Should I put these triangle vertices in a vector and then pass them to build a k-d tree? Also does someone have a tutorial or a sample source code where a ply model is passed to the k-d tree and the k-d tree is then traversed to ray trace the scene? If anybody has a sample code which they can share, pls let me know. Thanks.
PLY is a file format for objects described as a collection of polygons. A KD Tree is an optimisation structure designed to speed up rendering times by eliminating unnecessary intersection tests.
So you need to:
Use google to find more info and sample code for KD Trees. The standard paper is by Vlastimil Havran which is available on-line.