Hi Justin,
Thanks for your response to my question in J3D interest group.
I have tried the USE_BOUNDS method in the collision constructor instead of
the USE_GEOMETRY parameter. Although the speed has increase significantly
from the 8mins to 14sec., the accuracy of such method is unacceptable. Is it
possible to setup a CollisionBounds around an object using its shape3d
information (vertices information).
Instead of separating collidable and non-collidable objects in the
scenegraph. Is it possible to instruct the collision detection node to only
perform collision detection within a certain radius (volume) around an
object. For example, if there is no objects within a 2 meters radius of a
particular object (Object A), the collision detection will not be activated.
If another object (Object B) is within the 2m radius of Object A, the
collision detection node will activate and detect any possible collision
between Object A and parts of Object B which are within the 2m radius of
Object A.
If the above approach is possible, it will greatly reduce CPU time (even in
USE_GEOMETRY mode) and at the same time maintain high level of accuracy.
Please comments.
cheers,
Sunny Leung
-----Original Message-----
From: Justin Couch [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 26, 1999 1:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Optimising collision detection in J3D
Leung, Sunny wrote:
> So is it possible to tell the collision detection node to detect collision
> only within a certain radius (volume) around the object which the node is
> attached onto?
There are two things that you need to do. Firstly, for any objects that
you _don't_ want to collide with, you turn collision detection off using
setCollidable(false) defined in Node. The easiest way to do this is
partition the scene graph into two groups - collidable and not
collidable areas. Then, the parent group of all the not collidable stuff
you setCollidable(false). This then works for all children of the group
so that you don't need to explicitly set it.
Next, you set the bounds for the objects you do want to collide with
using the setCollisionBounds method of the parent group of the
collidable object (defined in the Group class). If you want a spherical
bounds for your object use BoundingSphere as the object that you set.
Finally, when constructing your behaviour criterion, make sure you set
it with the Node and the speed hint of USE_BOUNDS. I think you can also
use the constructor that takes the Bounds reference and it automatically
uses the USE_BOUNDS speed hint, but the docs aren't particularly clear
on this.
--
Justin Couch Author, Java Hacker
Snr Software Engineer [EMAIL PROTECTED]
ADI Ltd, Systems Group http://www.vlc.com.au/~justin/
Java3D FAQ: http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
Turn it or move it, and a new set of arrangements appears... is it
a single light or many lights, lights that one must know how to
distinguish, recognise and appreciate? Is it one light with many
frames or one frame for many lights?" -Subcomandante Marcos
-------------------------------------------------------------------
===========================================================================
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".