import-bot (20211) [Avatar] Offline
#1
[Originally posted by abergstr]

I'm in the middle of developing an applet that takes distance measurements
from artifact models. Though the book mentions how to get the 3D point
location from the intersection of a pick, the book doesn't give an example as
to how it's implimented. I can't seem to figure it out either. All I want is
the 3D intersection point, what's the best way to go about getting it using
the pick engine?
import-bot (20211) [Avatar] Offline
#2
Re: 3D Hit Point
[Originally posted by author]

Look at j3dui.control.mappers.PickEngine, specifically the pickTarget()
method. The last argument is hitPoint. If it is specified as non-null, the
hit point, if any, will be returned in it. To see how it's done, look at the
source code.

--jon


> I'm in the middle of developing an applet that takes distance measurements
> from artifact models. Though the book mentions how to get the 3D point
> location from the intersection of a pick, the book doesn't give an example as
> to how it's implimented. I can't seem to figure it out either. All I want is
> the 3D intersection point, what's the best way to go about getting it using
> the pick engine?
import-bot (20211) [Avatar] Offline
#3
Re: 3D Hit Point
[Originally posted by abergstr]

I appreciate the help, but I still can't figure it out. I spent the day
combing the book and the nearest I can figure is that loaded VRML models can't
be intersected. Granted I am a novice at this sort of thing (archaeology grad
student), but everytime I try to put the AffineGroup holding the VRML node
into the buildOverEnabler method, I get a "CapabilityNotSetException: Shape3D:
no capability to allow intersect" Does that mean that the capability cannot be
set or that it hasn't been set even though it can be? I've tried to set it
believe me.

To get an idea of what we're trying to do with Java3D, visit:
http://atl.ndsu.edu/grants/eai/caliperV2.html

Make sure you have the cosmoplayer plugin. It uses the VRML EAI so the applet
might not work in Internet Explorer.

The overall research project can be viewed at:
http://atl.ndsu.edu/archive/

Anyway, any help you can give me would be appreciated. We have a Great Plains
Network(Internet2) conference and an NSF conference this week as well, and we
were hoping that we might have the calipers implemented before we gave our
applet demonstrations... See:
http://zydeco.cc.ndsu.nodak.edu/~flarson/ATL/

Thanks,

Aaron

> Look at j3dui.control.mappers.PickEngine, specifically the pickTarget()
> method. The last argument is hitPoint. If it is specified as non-null, the
> hit point, if any, will be returned in it. To see how it's done, look at the
> source code.
>
> --jon
>
>
> > I'm in the middle of developing an applet that takes distance measurements
> > from artifact models. Though the book mentions how to get the 3D point
> > location from the intersection of a pick, the book doesn't give an example
as
> > to how it's implimented. I can't seem to figure it out either. All I want is
> > the 3D intersection point, what's the best way to go about getting it using
> > the pick engine?
import-bot (20211) [Avatar] Offline
#4
Re: 3D Hit Point
[Originally posted by author]

I see. Your problem lies in other areas. The javadoc at the head of the
PickEngine class summarizes the requirements for doing picking (the book goes
into greater detail, and ties it all together in a picking "model").

"...For a target node to be pickable it must lie under the pick root in the
scene graph, its ENABLE_PICK_REPORTING capability must be set, its leaf shape
nodes must be set pickable (which is true by default), and for geometry
picking, the leaf shape geometry must be intersectable."

If you import geometry from the VRML loader, and you want to do geometry
picking, then you will have to dig into each shape and set the capability bits
on its geometry to be intersectable.

good luck
--jon

> I appreciate the help, but I still can't figure it out. I spent the day
> combing the book and the nearest I can figure is that loaded VRML models can't
> be intersected. Granted I am a novice at this sort of thing (archaeology grad
> student), but everytime I try to put the AffineGroup holding the VRML node
> into the buildOverEnabler method, I get a "CapabilityNotSetException: Shape3D:
> no capability to allow intersect" Does that mean that the capability cannot be
> set or that it hasn't been set even though it can be? I've tried to set it
> believe me.
>
> To get an idea of what we're trying to do with Java3D, visit:
> http://atl.ndsu.edu/grants/eai/caliperV2.html
>
> Make sure you have the cosmoplayer plugin. It uses the VRML EAI so the applet
> might not work in Internet Explorer.
>
> The overall research project can be viewed at:
> http://atl.ndsu.edu/archive/
>
> Anyway, any help you can give me would be appreciated. We have a Great Plains
> Network(Internet2) conference and an NSF conference this week as well, and we
> were hoping that we might have the calipers implemented before we gave our
> applet demonstrations... See:
> http://zydeco.cc.ndsu.nodak.edu/~flarson/ATL/
>
> Thanks,
>
> Aaron
>
> > Look at j3dui.control.mappers.PickEngine, specifically the pickTarget()
> > method. The last argument is hitPoint. If it is specified as non-null, the
> > hit point, if any, will be returned in it. To see how it's done, look at
the
> > source code.
> >
> > --jon
> >
> >
> > > I'm in the middle of developing an applet that takes distance measurements
> > > from artifact models. Though the book mentions how to get the 3D point
> > > location from the intersection of a pick, the book doesn't give an example
> as
> > > to how it's implimented. I can't seem to figure it out either. All I
want is
> > > the 3D intersection point, what's the best way to go about getting it
using
> > > the pick engine?
import-bot (20211) [Avatar] Offline
#5
Re: 3D Hit Point
[Originally posted by author]

BTW: I forgot to mention that I provide a utility for conveniently setting
geometry intersection. Take a look at j3dui.utils.PickUtils.

--jon


> I see. Your problem lies in other areas. The javadoc at the head of the
> PickEngine class summarizes the requirements for doing picking (the book goes
> into greater detail, and ties it all together in a picking "model"smilie.
>
> "...For a target node to be pickable it must lie under the pick root in the
> scene graph, its ENABLE_PICK_REPORTING capability must be set, its leaf shape
> nodes must be set pickable (which is true by default), and for geometry
> picking, the leaf shape geometry must be intersectable."
>
> If you import geometry from the VRML loader, and you want to do geometry
> picking, then you will have to dig into each shape and set the capability bits
> on its geometry to be intersectable.
>
> good luck
> --jon
>
> > I appreciate the help, but I still can't figure it out. I spent the day
> > combing the book and the nearest I can figure is that loaded VRML models
can't
> > be intersected. Granted I am a novice at this sort of thing (archaeology
grad
> > student), but everytime I try to put the AffineGroup holding the VRML node
> > into the buildOverEnabler method, I get a "CapabilityNotSetException:
Shape3D:
> > no capability to allow intersect" Does that mean that the capability
cannot be
> > set or that it hasn't been set even though it can be? I've tried to set it
> > believe me.
> >
> > To get an idea of what we're trying to do with Java3D, visit:
> > http://atl.ndsu.edu/grants/eai/caliperV2.html
> >
> > Make sure you have the cosmoplayer plugin. It uses the VRML EAI so the
applet
> > might not work in Internet Explorer.
> >
> > The overall research project can be viewed at:
> > http://atl.ndsu.edu/archive/
> >
> > Anyway, any help you can give me would be appreciated. We have a Great
Plains
> > Network(Internet2) conference and an NSF conference this week as well, and
we
> > were hoping that we might have the calipers implemented before we gave our
> > applet demonstrations... See:
> > http://zydeco.cc.ndsu.nodak.edu/~flarson/ATL/
> >
> > Thanks,
> >
> > Aaron
> >
> > > Look at j3dui.control.mappers.PickEngine, specifically the pickTarget()
> > > method. The last argument is hitPoint. If it is specified as non-null,
the
> > > hit point, if any, will be returned in it. To see how it's done, look at
> the
> > > source code.
> > >
> > > --jon
> > >
> > >
> > > > I'm in the middle of developing an applet that takes distance
measurements
> > > > from artifact models. Though the book mentions how to get the 3D point
> > > > location from the intersection of a pick, the book doesn't give an
example
> > as
> > > > to how it's implimented. I can't seem to figure it out either. All I
> want is
> > > > the 3D intersection point, what's the best way to go about getting it
> using
> > > > the pick engine?
import-bot (20211) [Avatar] Offline
#6
Re: 3D Hit Point
[Originally posted by abergstr]

If anyone wants to know how to get the geometry of a loaded VRML file, see the
code below. We figured out how to get the 3D hitpoint information. If anyone
is interested in it you can send me an email, and I'll send you the code.

thing = ModelLoader.loadVrmlFromName(theFile);
Object childobject=thing.getChild(0);
TransformGroup tgroot=(TransformGroup)childobject;
Object shapeobject =tgroot.getChild(0);
Shape3D s3d=(Shape3D)shapeobject;
s3d.setCapability(s3d.ALLOW_GEOMETRY_READ);
s3d.setCapability(s3d.ENABLE_PICK_REPORTING);

We figured this out from a comment on Sun's message board concerning a
question about how to change the color of a loaded VRML object.
import-bot (20211) [Avatar] Offline
#7
Re: 3D Hit Point
[Originally posted by author]

BTW: The utility j3dui.utils.setGeoPickable(), mentioned in a previous
message, should do all of this for you. Just specify your "thing" object (or
some other lower level node) as the argument and the utility will recursively
walk the scene subgraph as needed and set all shapes to be geometry pickable.
Please let me know if this is not the case.

--jon


> If anyone wants to know how to get the geometry of a loaded VRML file, see the
> code below. We figured out how to get the 3D hitpoint information. If anyone
> is interested in it you can send me an email, and I'll send you the code.
>
> thing = ModelLoader.loadVrmlFromName(theFile);
> Object childobject=thing.getChild(0);
> TransformGroup tgroot=(TransformGroup)childobject;
> Object shapeobject =tgroot.getChild(0);
> Shape3D s3d=(Shape3D)shapeobject;
> s3d.setCapability(s3d.ALLOW_GEOMETRY_READ);
> s3d.setCapability(s3d.ENABLE_PICK_REPORTING);
>
> We figured this out from a comment on Sun's message board concerning a
> question about how to change the color of a loaded VRML object.