Hi, I've just downloaded Java3D 1.2 beta on WinNT and I am still experiencing substantial problems with picking using PickSegment and PickRay. I've had this open as a bug at JavaSoft for some time, but nobody has yet looked at it. I'm still not convinced that I am not making some user error. I wonder if anyone in the know would be prepared to take a quick look at the attached v.simple test case, and say whether it should work or not. The test case tries to pick a cube centred at the origin using a couple of PickSegments and a PickRay. The testcase generates different results under Java3D 1.1.2 and 1.2 beta. (The PickRay case worked under 1.1.2) The Bug Parade defect is: http://developer.java.sun.com/developer/bugParade/bugs/4275899.html It's been accepted as valid, but I'd really appreciate some comments. I am at the point where I have given up trying to take my Java3D app any further, since I can't reliably use PickSegments and PickRays to test for interaction between my objects. Thanks Rob ----snip---- import javax.media.j3d.*; import javax.vecmath.*; public class PSTest { public static void main(String[] args) { VirtualUniverse u = new VirtualUniverse(); Locale l = new Locale(u); BranchGroup bg = new BranchGroup(); CubeShape cs = new CubeShape(); // Cube centred about origin bg.addChild(cs); System.out.println("bg pickable" + bg.getPickable()); System.out.println("cs pickable" + cs.getPickable()); l.addBranchGraph(bg); // // Show that a PickSegment along the zaxis fails // (end point inside Shape3D's bounds) // PickSegment ps1 = new PickSegment( new Point3d(0.0,0.0, 0.0), new Point3d(0.0,0.0,+100.0)); System.out.println("Pick using segment 1 (Should return CubeShape) :" + l.pickAny(ps1)); // // Show that a PickSegment along the zaxis fails // (end point outside Shape3D's bounds) // PickSegment ps2 = new PickSegment( new Point3d(0.0,0.0,-0.5), new Point3d(0.0,0.0,+1.5)); System.out.println("Pick using segment 2 (Should return CubeShape) :" + l.pickAny(ps2)); // // Show that a PickRay along the z axis fails // PickRay pr = new PickRay( new Point3d(0.0,0.0,-100.0), new Vector3d(0.0,0.0,1.0) ); System.out.println("Pick using ray 1 (Should return CubeShape) :" + l.pickAny(pr)); } } ----snip---- The CubeShape class is as follows: ----snip---- import javax.media.j3d.*; import javax.vecmath.*; public class CubeShape extends Shape3D { private QuadArray cubeQA; private static float[] verts = { // front face 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, // back face -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, // right face 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, // left face -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, // top face 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, // bottom face -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, }; public CubeShape() { cubeQA = new QuadArray( 24, QuadArray.COORDINATES ); cubeQA.setCoordinates(0, verts); setGeometry(cubeQA); setPickable(true); cubeQA.setCapability(QuadArray.ALLOW_COUNT_READ); cubeQA.setCapability(QuadArray.ALLOW_COORDINATE_READ); } } ----snip---- =========================================================================== 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".
