Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Daniel Trstenjak, posted on March 20, 2002

Image Description, by Daniel Trstenjak

this is the first version of DCollide, a framework for the collision detection in VRML. DCollide uses sphere-hierarchies for the collision detection. The spheres you can in the picture represent the object in the 5th level of the hierarchy.

The whole collision detection algorithm is implemented in java. So the framework theoretical could be used with any browser which supports java and vrml.

Unfortunately there are some problems, so the usability is restricted to the combination of Internet Explorer 5.x and the vrml-plugin cortona. For other combinations I can't guarantee that it will work.

cu Daniel Trstenjak

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

March 21, 2002, 06:14 AM

Let's bet.
I'll win :)

ray/triangle checking is very expensive if you need to check a ray to a model of say 500 polygons. (not even thinking about 'real' models of 5000 polys and up)

To get to the point where you have to do a single ray/triangle-check you'd have to do probably somewhere between 5 and 20 sphere-checks in this tree.

What do you think is more expensive :
- 5 to 20 sphere-checks and a triangle check
- 500 triangle checks.


(achter een doos zachte waar zat een kabouter centraal processen te normaliseren)


March 21, 2002, 06:17 AM

Okay, you win :) I just thought I saw thousands of little spheres on the picture... Could someone explain this?


March 21, 2002, 06:23 AM

That's the tree-thingy :
you start out with one big sphere around the object.

You test for collision with the big sphere.
If you hit that sphere, you check the big sphere's children.
let's say it has 4 children.
You check each of the four children; if you hit one ( or more) you check that sphere's children again.

This way you're recursively refining your search.

What's shown here in the picture are the 'final' spheres of the lowest level - thus the children of all children of all children of all children of the big sphere :)

You're NOT going to check against ALL these spheres, that's the trick :)


March 21, 2002, 06:24 AM

Juts search on octree (or octtree) and read up on how they work, they're pretty well documented on the net.


March 21, 2002, 06:26 AM

Almost forgot :

(Tijdens het paarritueel viel de vrachtwagen tussen de zuid-europese hoenderzwaluw)


March 21, 2002, 11:15 AM

You could use the adagent spheres (center point) to calculate a plane.

Problem is either memory (if the spheres contain pointers to the other 3 closest to it) or processing (if they're worked out at runtime).

Personally I can't see the advantage of using spheres over an OBB tree.

Has anyone used both and would like to comment.


March 21, 2002, 12:02 PM

Here's the link:

Turns out he didn't implement it this way.


March 21, 2002, 12:04 PM

Thanks for the description. For some reason I just assumed you implemented it a different way. Still, it seems like it works well for you.


March 21, 2002, 01:39 PM

What I meant is that the end result is not an octree. Generating a sphere tree "using an octree" is rather inefficient, by the way.


March 21, 2002, 01:56 PM

I love permanent standards ........

cu Daniel


March 21, 2002, 04:21 PM

Okay, got it, I know what octrees are, but I think I got confused by not seeing the bigger spheres (higher up in the tree).

Oh man, this is really starting to look like a forum ;)

( de afgedankte feestdag smurfde vrolijk verder over het hazenpad en iedereen denkt dat dit duits )


March 24, 2002, 07:52 AM


>Will this framework work with C3PO models???
>And what about skeleton linked meshes???

Now it works for an object which consists of
the primitives : Sphere, Cone, Cylinder and Box.

But it could be upgraded to work with any shape.
For every other shape "only" a triangulation
algorithm have to be written.

>Are the spheres static or it will adapt on mesh update?


cu Daniel

This thread contains 42 messages.
First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.