Doug Gehringer wrote:
> > I am having a problem in picking lines...
>
> In the short term, try the pickingExt utilites at the www.j3d.org site. Much
> better pick code is coming in J3D 1.2 beta.
In a related question...
The pickExt utilities may help when you are trying to do "picking"
intersections, but what about non viewer location based line segments to
geometry collision tests (what I would think of as "regular" intersections)?
I am at the point where after getting a "true" back from a regular pick test
(a bounding test), I then have to transform my intersection segments into the
Shape3D's local coordinate system, then do a triangle by triangle test against
my segments to derive any useful geometric collision info (i.e. the point of
collision, the normal of the poly, etc.)
The Intersect class helps, since it does have "rayAndTriangle()", but the
set-up to use it is a terrible weakness in Java3D. For anyone who hasn't tried
this yet, you must remember you can't just test each triangle in a GeometryArray
against your rays because the triangle coordinates in a GeometryArray are LOCAL
and of course they should be, but if you test against those coords you will get
incorrect collisions. You must first get the localToVWorld matrix and either
transform all the coords in the GeometryArray or transform your rays (usually
the cheaper solution). THEN do the triangle tests.
Whew! All in all, it's not THAT bad, but if you've worked with other scene
graph APIs like I have, you will probably stumble here because you have to go to
such a low-level to get it to work.
My dream is to have collision routines where you set a bunch of info about
what kind of collision you want (i.e. Bounds to Bounds, Bounds to Geometry, Ray
to Bounds, Ray to Geometry) AND what kind of data you get back ( TRUE/FASLE,
point of collision, normal of poly of collision, Shape3D, etc. ) then feed it
the node(s) and the segments to test. I mean usually, for navigation behaviors,
I don't EVER want to know what node I hit, just the point and normal there!
--
TTFN
__________________________________________________________
Shawn Kendall Full Sail Real World Education
Course Instructor 3300 University BLVD
Virtual Reality Winter Park FL 32792
[EMAIL PROTECTED] http://www.fullsail.com
__________________________________________________________
===========================================================================
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".