I have about 25000 geometries stuffed into one Shape3D, and implement
picking with the following code (using 1.2.1 beta 2):
pickCanvas.setShapeLocation(currentEvent);
// get the starting position of the pick
Point3d eyePos = pickCanvas.getStartPosition();
// the pickClosest returns a PickResult with the picks (Shape3D
nodes that were picked)
// sorted by the distance from the ViewPlatform to the intersection
point.
PickResult pickResult = pickCanvas.pickClosest();
// if the click was on a Shape3D, and the picked entity is the
orbiter (the Shape3D 'part')
if ((pickResult != null) && (pickResult.getObject() == part) ) {
// from the Shape3D node that was picked, get the information on
the intersection point
PickIntersection pi = pickResult.getClosestIntersection(eyePos);
// from the pick intersection information, get the index of the
geometry array that was picked
int index = pi.getGeometryArrayIndex();
.....
Using a couple of strategically placed "System.out.println()" statements, I
have measured that it takes about 400ms to get the PickResult, and another
880ms to get the index of the geometry that was picked. This is quite a bit
longer than it takes to resolve the picked geometry when I use a separate
Shape3D for each polygon. I'm stuffing all the geometries into one Shape3D
to reduce the memory requirement, but it's not worth the severe slowdown.
Any ideas on how to make it faster? Any work going on to make it faster in
the release?
Daniel Dvorak
===========================================================================
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".