Hi Kevin, Dug,

it IS already possible to get the triangle that was intersected by pickray.
Method intersect() supplies the distance to the surface and so the hitpoint
can be calculated. In a second step the according geometry has to be checked
which triange does keep the hitpoint. That all takes a lot of calculation
time, mostly too much. I've tested geometries starting from 1500 points up
to 15000 points.
But all that could be done in a single step in the picking algorithm used by
Java3D. My proposal is to supply the coordinates of the hitten triangle in
method intersect(SceneGraphPath path, PickRay pickRay, double[] dist) of
Shape3D in member dist.
I also encountered another thing: the garbage collector gets really stressed
when you try to pick an object. Even more by continuous picking (moving the
mouse pointer over the surface). It seams that picking is producing a big
amount of objects that aren't used anymore. I remember the discussion here
about some code in the com.sun...package.
IMHO there is place for some optimizations using references instead of
creating new objects ?

Gernot
[EMAIL PROTECTED]
http://www.janet.de


> -----Original Message-----
> From: Kevin Rushforth [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 15, 1999 12:02 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] Picking and returning 3D coordinates...
>
>
> It is possible, but not yet implemented.  Look for it in J3D 1.2 beta.
>
>                         - Kevin
>
>
> >Date:         Tue, 14 Sep 1999 14:57:43 -0700
> >From: Doug Gehringer <[EMAIL PROTECTED]>
> >Subject:      Re: [JAVA3D] Picking and returning 3D coordinates...
> >To: [EMAIL PROTECTED]
> >
> >Hi Kevin,
> >
> >Your response is a bit cryptic.  Do you mean:
> >
> >        it is possible, see the javadoc for how
> >        it is possible, the information can be inquired and
> you can do it
> >            yourself
> >        it is possible, but not yet implemented.  Look for
> it in J3D 1.2 beta
> >
> >You may want to clarify a bit.
> >
> >Thanks
> >
> >Doug
> >
> >> Date: Tue, 14 Sep 1999 14:28:16 -0700
> >> From: Kevin Rushforth <[EMAIL PROTECTED]>
> >> Subject: Re: [JAVA3D] Picking and returning 3D coordinates...
> >> To: [EMAIL PROTECTED]
> >>
> >> Yes, this should be possible.
> >>
> >>                         - Kevin
> >>
> >>
> >> >From [EMAIL PROTECTED]  Tue Sep 14 10:29:08 1999
> >> >MIME-Version: 1.0
> >> >X-Mailer: Internet Mail Service (5.5.2448.0)
> >> >Date:         Tue, 14 Sep 1999 18:05:27 +0200
> >> >Reply-To: Discussion list for Java 3D API
> <[EMAIL PROTECTED]>
> >> >Sender: Discussion list for Java 3D API
> <[EMAIL PROTECTED]>
> >> >From: "Veith, Gernot" <[EMAIL PROTECTED]>
> >> >Subject:      Re: [JAVA3D] Picking and returning 3D coordinates...
> >> >To: [EMAIL PROTECTED]
> >> >
> >> >...great !
> >> >would it be possible to retrieve the triangle that was
> hitten by the pickray
> >> >or some other usefull information that allows to
> calculate the normal vector
> >> >of this triangle ?
> >> >
> >> >Gernot
> >> >[EMAIL PROTECTED]
> >> >http://www.janet.de
> >> >
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Kevin Rushforth [mailto:[EMAIL PROTECTED]]
> >> >> Sent: Tuesday, September 14, 1999 4:37 PM
> >> >> To: [EMAIL PROTECTED]
> >> >> Subject: Re: [JAVA3D] Picking and returning 3D coordinates...
> >> >>
> >> >>
> >> >> We are working on picking utilties for Java 3D 1.2 that
> will provide
> >> >> information about what was picked (closest vertex,
> position (x,y,z),
> >> >> etc.).  They won't be available for our upcoming alpha1
> release (later
> >> >> this month), but they should be available for Beta
> (later this year).
> >> >>
> >> >> --
> >> >> Kevin Rushforth
> >> >> Java 3D Team
> >> >> Sun Microsystems
> >> >>
> >> >> [EMAIL PROTECTED]
> >> >>
> >> >>
> >> >> >Date:         Mon, 13 Sep 1999 09:34:56 -0400
> >> >> >From: "Benedict, Jon K." <[EMAIL PROTECTED]>
> >> >> >Subject:      [JAVA3D] Picking and returning 3D coordinates...
> >> >> >To: [EMAIL PROTECTED]
> >> >> >
> >> >> >Hello,
> >> >> >     I have a picking class which
> >> >> >allows me to pick LightWave3D objects
> >> >> >inside of my universe.  I am having trouble
> >> >> >creating code to return the object's current
> >> >> >x,y,z position inside of the universe.  I would
> >> >> >like to post it to a textframe, which I know how
> >> >> >to do, if I can get the code to return the coords.
> >> >> >Here are pieces of the pick class.
> >> >> >Thanks,
> >> >> >
> >> >> >Kyle Benedict
> >> >> >[EMAIL PROTECTED]
> >> >> >
> >> >> >public class PickBehavior extends PickMouseBehavior
> >> >> >{
> >> >> >  LWViewer shape;
> >> >> >  private JTextPane Information;
> >> >> >
> >> >> >  public PickBehavior(Alpha alpha, Canvas3D canvas,
> >> >> BranchGroup root, Bounds
> >> >> >bounds, JTextPane InfoPane)
> >> >> >  {
> >> >> >    super(canvas, root, bounds);
> >> >> >    this.setSchedulingBounds(bounds);
> >> >> >    Information = InfoPane;
> >> >> >  }
> >> >> >
> >> >> >  public void updateScene(int xpos, int ypos)
> >> >> >  {
> >> >> >    shape = (LWViewer)
> >> >> pickScene.pickNode(pickScene.pickClosest(xpos, ypos,
> >> >> >       PickObject.USE_BOUNDS), PickObject.BRANCH_GROUP);
> >> >> >
> >> >> >    int x = ?????????????????  this is the code i do not
> >> >> know.  I need to
> >> >> >    int y = ??????                     get the x, y, and z
> >> >> coords so I can
> >> >> >display
> >> >> >    int z = ????????                  them.  LWViewer is an
> >> >> loader I wrote
> >> >> >for lightwave objects.
> >> >> >
> >> >> >   if (shape != null)
> >> >> >   {
> >> >> >     processEvent(x, y, z);
> >> >> >   }
> >> >> >  }
> >> >> >
> >> >> >}
> >> >> >
> >> >> >=============================================================
> >> >> ==============
> >> >> >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