Edward,

I have included a severely hacked version of TickTockCollision that tests for 
collisions between a ColorCube and 2 Group nodes - composed of 2 Box Shape3D objects.

The ColorCube has a MouseTranslate behavior attached so you can drag the cube around 
with the right mouse button down.

The Groups will beep on collision enter and on exit (color is not implemented).

This is similar to the example posted earlier in that it does not do exactly what you 
described. 

I confirmed your earlier result, in that if you add a second Box in the createBox 
routine and leave the collision detectors attached to the 2 Boxes, collision with 
either of the Boxes will not be detected (as you stated). This seems like a bug (?).
        
The example posted earlier and my code both work by attaching a Group (in my case) or 
a TransformGroup to the CollisionDetector behavior. This appears to work.

I would tend to agree with Tony Burrow's comments that the collision detection as 
implemented does not appear suitable for anything more complex than a simple 3D 
browser. A key problem is that the collision detection is running on a separate thread 
to the rendering - so that sometimes collisions are not reported until too late (i.e. 
the rendering is ahead) and sometimes too early (the frame has not yet been rendered). 
This is an architectural problem that is most visible on lower-end systems, but would 
become worse if more intensive collision detection algorithms were used. It would seem 
to be almost impossible to do robust Quake style collision detection in this way.

I have also been looking at the decompiled source of the BehaviorScheduler and 
CollisionThread classes. The code abounds (no pun intended!) with loops over objects 
in the scene and children of nodes... So scalability to many objects or complex scenes 
is probably going to be poor. Also adding a collision behavior after compile time (has 
anyone tried this?) requires some pretty intensive updates.

Sincerely,

Daniel Selman

[EMAIL PROTECTED]
http://www.tornadolabs.com 

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Edward K.
> O'Neil
> Sent: Monday, June 07, 1999 4:03 PM
> To: [EMAIL PROTECTED]
> Subject: [java3d] multiple Shape3Ds and collision detection
> 
> 
> 
> All--
> 
>   I've noticed that there's a lot of trouble out there with collision
> detection and the 3D API and have gone through several different
> possibilities trying to figure this out.  I've had significant trouble
> with this myself for anything but the simplest 3D shapes.  Initially, I
> had a 3D object composed of Primitive subclasses (Cylinder, Cone, etc...)
> and couldn't ever get collision detection working on those shapes (whether
> as standalone shapes or composed together in some more complex object).
> 
>   After seeing that the CollisionDetector class floating around (and
> in the API demos) takes Shape3D objects, I tried that, and you can collide
> a single Shape3D object with another single Shape3D object with no
> problem.  The trouble comes, however, when trying to rebuild that complex
> model out of Shape3D subclasses I wrote (which implement the cone,
> cylinder, and box as children of the Shape3D class).  As soon as I add
> more than one Shape3D object to the same TransformGroup, the collision
> detection stops working for either node.  This happens regardless of the
> bounds of the object, setBoundsAutoCompute(true), handcoded bounds, or no
> bounds at all.  I would have included code, but the only difference
> between the working and broken versions is the addition of another Shape3D
> child to a TransformGroup.
> 
>   Maybe I'm missing something significant.
> 
>   Has ANYONE been able to get collision detection working on objects that
> are composed of mulitple Shape3D objects (not those that have the full
> coordinates specified in TriangleFanArrays but are actually compositions 
> of several objects)?  Or, has anyone been able to collison detect on
> similar compositions of Primitive subclasses?
> 
>   Does anyone have an idea when the collision detection issues will be
> worked out in the API?
> 
>   Thanks in advance for any help/info.
> 
> Edward O'Neil
> 
> 
> 
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
> 

collision.zip

Reply via email to