Hello All,

I am trying to use PickConeSegment to pick in my scene. The scene is
composed of a sphere (the earth) centered at 0, 0, 0. The sphere has a 1000
unit radius and is composed of individual cells (Shape3Ds) of about 50 x 50
units. Each cell is a square TriangleStripArray. The cells and the
BranchGroup holding the cells all have bounds auto compute enabled. My goal
is to determine which cells the user can see. The user can orbit the sphere
in any direction (always looking at 0,0,0).

To do this, I am creating a PickConeSegment with the start point at the eye
position (from the canvas and then transformed to vworld) and the end point
at 0, 0, 0 (center of the sphere). I am using a 45 degree angle on the cone
to match the field of view. I am doing simple bounds picking since I do not
need fine accuracy (speed is important).

This all seems to work fine, but instead of getting just the front side of
the sphere, I am getting all the cells in the sphere (even those on the
backside). This is really hurting performance since I end up processing
cells that the user cannot actually see. From my understanding of the
limited docs, the PickConeSegment should be stopping at 0,0,0, therefore
never intersecting the back side of the sphere.

Could someone explain what I may be doing wrong? My pick code looks like:
    // Get the starting point by putting the eye position into the
    // virtual world
    Point3d eyePos = new Point3d();
    Transform3D imagePlateToVworld = new Transform3D();
    Canvas3D canvas = mRenderingContext.getView().getCanvas3D(0);
    canvas.getCenterEyeInImagePlate(eyePos);
    canvas.getImagePlateToVworld(imagePlateToVworld);
    imagePlateToVworld.transform(eyePos);

    //System.out.println("Eye pos: " + eyePos);

    // Pick the visible tiles
    PickConeSegment pickCone = new PickConeSegment(eyePos, new Point3d(),
        getView().getFieldOfView());
    SceneGraphPath[] pickedPaths = mSurfaceTilesBG.pickAll(pickCone);


Thanks in advance,
-mike

--
Mike Pilone <[EMAIL PROTECTED]>        http://www.slac.com/mpilone/personal/
GPG Fingerprint = 856C 8B36 ECF7 9156 4611  7C6B C265 05C4 162F C3B5

See http://www.slac.com/mpilone/personal/mpilone_pub_key.gpg for full key.
See http://www.gnupg.org for GPG information.

===========================================================================
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