Hi, Kelvin: Thank you very much! You are right for the 2nd problem, that's because of the wrong bounds computed by the J3d class. When I set Geometry mode, it works correctly.
For the 3rd problem, you are right if I use PickRay instead of PickPoint, there are no runtime exception, but if I just look at the API documentation, I just think the 2 classes can be used similarly, I don't think there are any document in the API says that we can't use PickPoint with PickResult, do we? Actually, in my case, my idea is when I click near a common point shared by both polygons, I use getClosestVertex to get the common point, and then use it as a intersection point to pick all polygons connected with this point, so PickPoint is enough, PickRay is Redundant. I created the PickRay, like " new PickRay(localPt, new Vector3d(0, 0, 1)) ", I think this direction is ok in my case, and I debugged the program, the localPt is actually the common point that I expect to choose, but the PickResult of the PickAllSorted only get one of the polygons not both of them. I even tried to set PickTolerance, but it seems don't have any effect. Could you check this for me? Thank you so much! Regards, white On Thu, 25 Jul 2002 15:35:58 -0700, Kelvin Chung <[EMAIL PROTECTED]> >White Morph wrote: > >> Hi, >> >> I have 2 polygons, each uses GeometryInfo to generate its indexedGeometryArray. A >BranchGroup is created to add both Shape3D objects into it. There are some problems: >(please see my code attached, you can try) >> >> 1. if I just add either of the 2 Shape3D objects into the BranchGroup, the bounding >center is just the same as I add all of them into the group, so I guess the Java3D >class calculate the bounding center using all of the vertices instead of only the >vertices the Geometry object refers to. >> > > >Bug 4720938 >- IndexedGeometry shouldn't consider vertex not reference by index in >computeBound > >is submitted for this. Current implementation will use all vertices pass >in IndexedGeometryArray even though some of them is not actually >reference by index array. > > >> 2. when I just add one of the polygons into the group, the picking for this polygon >is correct, but if I add both of them into the group, the picking for the first one >is not correct, the second one is correct. >> > >Bounds picking is used by default and both Geometry occupy by the same >bound. So it is possible for this case happen. > >Add > >pickCanvas.setMode(PickTool.GEOMETRY); > >in the constructor of PickAllMouseBehavior should fix it. > > > >> 3. Even when I just add one polygon into the group, if I use >PickCanvas.setShape(PickPoint, startPoint) before I use pickAllSorted(). I got a >Runtime exception: java.lang.RuntimeException: PointArray0 >> >> Could you please try my code? Did I have sth wrong or else? Thank you very much! >> > > >PickPoint is not support in PickResult so RuntimeException throws. >Try to use PickRay in this case. > >Thanks. > >- Kelvin >------------------ >Java 3D Team >Sun Microsystems Inc. > > =========================================================================== 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".
