The J3D Fly-Though has a good collision avoidance routine. Load it up, import your own model and then turn on colliosn detection to see how it performs. The code seems pretty straight forward, using a pick section utilitsing the current viewpoint and the estimated viewpoint next frame to determine what's in the scene path.
I will probably use the code in my own projects. It runs fine on a PIII 1Ghz card at mo for a complex 3DS model. Regards Sky -----Original Message----- From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of Roland Sarrazin Sent: 04 October 2001 13:04 To: [EMAIL PROTECTED] Subject: [JAVA3D] 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".
