Ray tracing

Martin Schreiber schreiberx at googlemail.com
Fri Feb 20 17:29:48 UTC 2009


hi olivier!

i think that libkdtree is not the thing you are searching for because it
operates point-wise only. it's possible to improve the intersection with
kdtrees but it's not as good as other methods. there's no explicit
method for ray intersection within a kdtree.

to compute an efficient ray intersection with triangles, usually a bsp
trees or octtree is used:
http://en.wikipedia.org/wiki/Binary_space_partitioning
http://en.wikipedia.org/wiki/Octtree

i used octtrees by myself because it's quite easy to implement it
(building up the octtree) as well as computing the intersections with
the cells.

feel free to ask further questions or correct me if i misunderstood you.

greez,
  martin




On Fri, 2009-02-20 at 17:39 +0100, Olivier Tournaire wrote:
> Hi all,
> 
> I recently discovered libkdtree++ and it seems to be really
> interesting. However, before using it in one of my project, I need a
> few questions and I hope you could help me.
> I need to index triangles for fast intersection with rays computing.
> So, I think I have to write two classes, one for 3d points, another
> for 3d triangles which contains 3 points  as members. First question:
> which operators do I have to define in order to buil a kdtree to index
> my triangles ? Next, how do I instanciate the KDTree class ?
> Then, I would like to know, once the kdtree is built, which cells are
> intersected by a given 3d ray. How can I achieve this ? Last, once I
> know which cells the ray goes through, I would like to access the
> triangles contained in. Any tip ?
> 
> Hope I am clear enough to get some help ...
> 
> Best regards,
> 
> Olivier
> 
> -- 
> Olivier Tournaire
> MATIS - Institut Géographique National
> 73, Ave de Paris
> 94165 St Mandé cedex, France
> 
> tel: (+33) 1 43 98 80 00 - 71 25
> fax: (+33) 1 43 98 85 81
> _______________________________________________
> libkdtree-devel mailing list
> libkdtree-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel




More information about the libkdtree-devel mailing list