> From: "Gernot Veith" <[EMAIL PROTECTED]>
> 
> I am actually trying to calculate the hitpoint of a pickray on a triangleArray 
(about 15.000 
> polygons). Everything works fine, I am using the intersect - method of Shape3D 
which 
> also provides the distance to the hitpoint. But it takes 200 up to 1000 msecs 
! (P II 350, 
> 128MB ram). Does anybody knows a more efficient way to solve that ?


The intersection code will try to find the intersection of your ray with every 
single one of your 15000 triangles.  

A much more efficent implementation will be to break up your triangle array into 
smaller groups and then test for an intersection of the ray with the bounding 
sphere for each group before testing the individual triangles of the group.

Try to break up your triangle list using a settable parameter for the "chunk" 
size.  That way you can tune the implementation to get a good balance between 
display speed and picking speed (display is faster with a few large shapes but 
picking is faster if the shapes are small enough to discard lots of data based 
on the bounds).

Doug Gehringer
Sun Microsystems

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to