The fastest approach would be to store your triangles in vworld form in an
oct tree and cast a ray against it.  This would be in addition to the
geometry used to display.  If speed is not absolutely essential then divide
your geometry up into multiple non-intersecting bounds and let Java3d pick
the shape using a ray -> bounds check.  Once you have the nearest
intersecting shape you can either scan the triangles yourself, or cast the
ray just against that shape using geometry intersection.

Dave Yazel

-----Original Message-----
From: Roger Berggren [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 3:51 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Fastest way to find intersection point


Hi,

I'm trying to find the closest intersection point between the mouse
position and a huge (700, 000 vertices) Shape3D.

What is the best approach to try to find the closest intersection
point as fast as possible.

I have tried the com.sun.j3d.utils.picking classes, but for this size
they seem a bit slow, but they find the local coordinates correctly.

I also tested the IntersectionUtils from org.j3d.geom. They seemed
faster, but instead I have problems getting them to work correctly.

So I have one that's slow but correct and one that's fast but
not working :-)

How do one best organize the scenegraph with such a large
Shape3D for best picking performance?

Do you have 70 Shape3Ds with 10000 vertices or
1 Shape3D with 70 geometries or a single GeometryArray?

Any ideas, thoughts or examples are greatly appricated.

Best Regards,

Roger Berggren

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to