Hi,
I have TriangleStripArray where the coordinates are created
using J3DBuffer.
When trying to find the closest point on the surface (from the
mouse x, y location) the PickTool code stops working.
The following code works fine using normal geometry, but not
when using nio buffers.
pickCanvas.setShapeLocation(x, y);
PickResult results = pickCanvas.pickClosest();
if ( results != null )
{
PickIntersection info = results.getIntersection(0);
intersectionPoint = new Point3f(info.getPointCoordinates());
}
But with nio buffers you get the following error:
java.lang.IllegalStateException: GeometryArray: must not be in
USE_NIO_BUFFER mode to use this method
at
javax.media.j3d.GeometryArray.getCoordRefDouble(GeometryArray.java:4319)
at com.sun.j3d.utils.picking.PickResult.intersect(PickResult.java:669)
at
com.sun.j3d.utils.picking.PickResult.generateIntersections(PickResult.java:635)
at
com.sun.j3d.utils.picking.PickResult.numIntersections(PickResult.java:422)
at
com.sun.j3d.utils.picking.PickTool.pickGeomAllSortedIntersect(PickTool.java:854)
at
com.sun.j3d.utils.picking.PickTool.pickGeomClosestIntersect(PickTool.java:915)
at com.sun.j3d.utils.picking.PickTool.pickClosest(PickTool.java:566)
...
Is there a simple way to find the this kind of intesection, or
do I have to do my own implementation?
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".