Is it poosible or safe  to use PickIntersection and PickResult classes to
simplify the problem.
first constructing the PickResult using the sceneGraphpath and the node I
got for calling BranchGroup.pickall,  then calling getIntersection()

The method should return null if the holes are not solid, otherwise if not
null ,they might be solid but 100% transparent (like you said)

Is this reliable?

THANKYOU
BASSAM


----- Original Message -----
From: "John Wright" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 03, 2004 12:49 AM
Subject: Re: [JAVA3D] picking the table


> You probably have it modeled as a single object and thus with bounds
> picking you get a "hit" even in places where your object isn't solid.
> You might need to do geometry picking to be more precise.  Also beware
> that a "hole" through an object may just be an "invisible" surface (100%
> transparent).
>
> - John Wright
> Starfire Research
>
> Bassam wrote:
>
> > Thanks John, it works.
> > Just one question about picking through holes of a body. I am picking
> > downwards and I get the billiard table . Fine, but even above the
pockets I
> > still get the table. It seems that the 3ds loader has made my table as a
> > square with no holes in it,such that as long as you are above the table
you
> > will pick it.Maybe it is a picking bug?
> > Has anyone experienced such thing with picking?
> >
> > My Table is a square with 6 pockets in it. it was done using 3ds max.
> > THANK YOU
> > BASSAM
> >
> > ----- Original Message -----
> > From: "John Wright" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, June 02, 2004 7:33 PM
> > Subject: Re: [JAVA3D] picking the table
> >
> >
> >
> >>Bassam, your code does not pick straight "down" from your point.  Try
> >>something more like:
> >>      Point3d end = new Point3d(point.x ,point.y-5 ,point.z );
> >>      Point3d start = new Point3d(point);
> >>
> >>- John Wright
> >>Starfire Research
> >>
> >>
> >>Bassam wrote:
> >>
> >>
> >>>Sorry John it didn't work.It gives the same result  (NULL).
> >>>
> >>>As my last choice I will post some of the code. Maybe you can figure
out
> >>>somethig wrong. Here it is:
> >>>
> >>>
> >>>///////////////////////////////////////////////////////
> >>>//This checks downwards  .Parameter "point" is the center of the ball
> >>>///////////////////////////////////////////////////////
> >>>public void CheckPocketed(Point3f point){
> >>>    Point3d end = new Point3d(0 ,-5 , 0 );
> >>>    Point3d start = new Point3d(point);
> >>>    SceneGraphPath[] result = null;
> >>>    start.add( end);
> >>>    PickSegment pickSegment= new PickSegment(start, end);
> >>>    result = branch.pickAll(pickSegment);
> >>>    if (result == null) { System.out.println("Ball Falling!"); }
> >>>    else System.out.println("Ball NOT Falling!");
> >>>}
> >>>///////////////////////////////////////////////////////
> >>>////This is another class that creates the table and the lamp. I set
> >
> > picking
> >
> >>>capability bits too.
> >>>///////////////////////////////////////////////////////
> >>>public class Table extends TransformGroup{
> >>>    TransformGroup TableTG;
> >>>    TransformGroup LampTG;
> >>>    public Table() {
> >>>        this.setCapability(Node.ENABLE_PICK_REPORTING);
> >>>        String filename = "3DModel\\pooltable.3DS";
> >>>        Scene theScene = null;
> >>>        Scene accessory = null;
> >>>        ///////////////////////
> >>>        //Creating the Table///
> >>>        Loader3DS loader = new Loader3DS();
> >>>        TableTG = new TransformGroup();
> >>>        try{
> >>>            theScene = loader.load(filename);
> >>>            TableTG.addChild(theScene.getSceneGroup());
> >>>            TableTG.setCapability(Node.ENABLE_PICK_REPORTING);
> >>>            TableTG.setPickable(true);
> >>>        }
> >>>    catch ( IOException e )
> >>>    {
> >>>        System.err.println( "** Exception: " + e.getMessage() );
> >>>        e.printStackTrace( System.err );
> >>>     }
> >>>    Transform3D trans3D = new Transform3D();
> >>>    trans3D.setTranslation(new Vector3f(0.0f,-0.8f,0.0f));
> >>>    trans3D.setScale(0.7);
> >>>    TableTG.setTransform(trans3D);
> >>>    addChild(TableTG);
> >>>
> >>>//Etc.  The file creates other elements that are add to transformgroups
> >>>other than TableTG.
> >>>
> >>>
> >>>THANK YOU
> >>>BASSAM
> >>>
> >>>----- Original Message -----
> >>>From: "John Wright" <[EMAIL PROTECTED]>
> >>>To: <[EMAIL PROTECTED]>
> >>>Sent: Wednesday, June 02, 2004 2:59 PM
> >>>Subject: Re: [JAVA3D] picking the table
> >>>
> >>>
> >>>
> >>>
> >>>>Bassam,
> >>>>
> >>>>Try using pickAll rather than pickAny.  We ended up rewriting all our
> >>>>terrain following routines because of buggy picking utilities.
> >>>>
> >>>>- John Wright
> >>>>Starfire Research
> >>>>
> >>>>Bassam wrote:
> >>>>
> >>>>
> >>>>
> >>>>>I just want to add more details. The table was done by 3ds Max
program
> >>>
> >>>and saved as 3ds format. I ,then, loaded it using John's Wright loader
> >
> > and
> >
> >>>add it to a transform group. I set the group's  setPickable(true);
> >>>
> >>>
> >>>>>The ball is a transform group which has sphere as child .using
> >>>
> >>>PickSegment ,I am picking from the center of the sphere (transformed
> >
> > center)
> >
> >>>downwards (I add a point below the center to it), but I am getting
null.
> >>>
> >>>
> >>>>>Have I missed somthing? What's wrong?
> >>>>>Bassam
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> I have a ball on a billliard table each is add to different
transform
> >>>
> >>>group. The problem is that I am trying to make the ball to pick
> >
> > downwards to
> >
> >>>check if it is on the table or pocketed. However ,after picking
> >>>scenegraphpath is null, even though the ball is above the table. I am
> >
> > using
> >
> >>>Picksegment and calling branchgroup.pickAny().
> >>>
> >>>
> >>>>> Can you help me telling me what is wrong?
> >>>>>
> >>>>> Bassam
> >>>>>
> >>>
> >>>
> >
===========================================================================
> >
> >>>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".
> >>>
> >>>
> >
===========================================================================
> >
> >>>>>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".
> >>>>
> >>>>
> >
===========================================================================
> >
> >>>>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".
> >>>>
> >>>
> >>>
> >>>
> >
===========================================================================
> >
> >>>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".
> >>>
> >>
> >>
> >
===========================================================================
> >
> >>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".
> >
> >
> >
===========================================================================
> > 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".
> >
>
>
===========================================================================
> 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".
>

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