Daniel,

So I'd need to set up the scene and then shake each shape a little to find
out collisions. Also according to what I remember, you only get one
collision at a time, so this wouldn't help much. Thanks anyway.

Pasi

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Daniel Selman
Sent: 4. lokakuuta 2001 15:30
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Collision avoidance, bounds & co


Pasi,

No, I don't think so, the data-structures are internal to the Java 3D
implementation. If the objects really don't move you could calculate the
collision once however and then cache the result (in the User Data for each
object?).

Sincerely,

Daniel Selman

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Pasi Paasiala
Sent: Thursday, October 04, 2001 6:27 AM
To: [EMAIL PROTECTED]
Subject: Re: Collision avoidance, bounds & co


Daniel,

would it be possible to use the BSP tree in Java 3D to find "static
collisions". That is, if I have two shapes that don't move but they overlap
partially, is there a quick way to find this out.

Pasi

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Daniel Selman
Sent: 4. lokakuuta 2001 15:16
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Collision avoidance, bounds & co


Roland,

I have an example program that uses the code below for picking, which works
for my purposes. You mention lots of performance problems, but you don't
give us any information on the likely culprits for the poor performance.

Have you run any performance analysis tools on your application, such as
JProbe or OptimizeIt. Perhaps the hotspots are in your code? Heaven, forbid!
;-) Common problems are excessive object creation in key routines that are
being called on every frame.

AFAIK, Java 3D uses a BSP tree to store the bounds of objects in the
scenegraph.

Best of luck.

Sincerely,

Daniel Selman

==========

        // rewritten to check for user data
        public void mouseClicked( MouseEvent e )
        {
                System.out.println( "*** MouseClick ***" );

                pickCanvas.setShapeLocation( e );
                PickResult[] results = pickCanvas.pickAllSorted( );

                if( results != null )
                {
                        for (int n = 0; n < results.length; n++ )
                        {
                                PickResult pickResult = results[n];

                                System.out.println( "Sorted PickResult " + n
+ ": " + pickResult );

                                Node actualNode = pickResult.getObject( );

                                if( actualNode.getUserData( ) != null )
                                {
                                        System.out.println( "Sorted Object "
+ n + ": " +
actualNode.getUserData( ) );
                                }
                        }
                }

                PickResult pickResult = pickCanvas.pickClosest( );

                if( pickResult != null )
                {
                        System.out.println( "Closest PickResult: " +
pickResult );

                        Node actualNode = pickResult.getObject( );

                        if( actualNode.getUserData( ) != null )
                        {
                                System.out.println( "Closest Object: " +
actualNode.getUserData( ) );
                        }
                }

        }

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Roland Sarrazin
Sent: Thursday, October 04, 2001 6:04 AM
To: [EMAIL PROTECTED]
Subject: Collision avoidance, bounds & co


Hello,

I'm really sorry to get to this topic again (collision avoidance), but I
have been relatively disappointed of all what I have found until now about
it, as well as I haven't been convinced about my own programming trials!

As a matter of fact, the problem is not that I haven't been able to set up
my own collision avoidance method; no, the problem is in fact towards
performance issues: This is all so slow!

What I am doing is using Java3D structures to store and display all what
concerns geometry and so on, but rather than using Java3D's behaviours and
picking (I have never been able, though, to use PickTool and PickResult
within my program - always returned no intersections when trying to
pickIntersect - see older e-mail to this list), I have implemented my own
procedures (using for intersection computation j3d's pieces of code) to
traverse the scene graph, comparing my PickSegment first with the bounds,
and then if necessary with the geometry.

Functionnaly it works all fine; I get the right intersection point. The
problem is, as said, that performances are bad. I test about 1000 segments
against a model with 17000 faces, and it's slow.

I had thought that I would "manually" arrange the scene graph so that the
tree is sort of a binary tree where bounds would be better arranged and
would speed up everything (classical collision avoidance algorithm with
space division), but the only results I got were a significant loss of
performances, which was not exactly what I was seeking. I think that this is
due to the considerable overhead implied by using the scene graph to "store"
this multi-level bounds.

My question is then: Who has ever implemented an efficient collision
avoidance method, and how? Does Java3D use intern multi-level bounding
volumes? If yes, how on earth is it possible to use PickTool, PickIntersect
and PickResult together to get a result (Is there a piece of tutorial about
it? The SUN Java3D tutorial mentions deprecated classes to be used for
picking (Intersect), so I'm not convinced!)? I'm very close to get totally
away from Java3D structures to implement my own one for collision avoidance,
and so that I can "control" performance, even though I think I won't be able
to achieve such a good efficiency as with native code (and Java3D is written
in native code, no?).

Another nearly linked question: How good are Java3D's bounds'
autocomputation? How often does the computation take place? At every
geometry change?

Thanks a lot for your attention, and thanks in advance for your answers!

Roland

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