POV-Ray : Newsgroups : povray.advanced-users : collision detection : Re: collision detection Server Time
29 Jul 2024 18:26:03 EDT (-0400)
  Re: collision detection  
From: Francois Labreque
Date: 22 Feb 2001 10:46:26
Message: <3A9533B0.CDE4E377@videotron.ca>
Christoph Hormann wrote:
> 
> Paul Jones wrote:
> >
> > How can I create a collision detection routine? More specifically, what
> > do I look at to determine if two objects have collided in pov-space ? I
> > can figure it out with...say... unit spheres, that is easy, but what
> > about rotated cubes and more oddly shaped objects??
> >
> 
> In general that's a very difficult task, one method would be doing a lot
> of tests with 'trace'.
> 
> Finding out whether two boxes collide could for example be done by
> 'tracing' along all their edges.

You can limit the number of traces necessary if you first find the
min_extent and max_extent of your objects.  If these don't overlap, then
your objects don't touch one another.  If they do, then you have to
start tracing along the side(s) where the bounding boxes overlap.

Note: You need MegaPOV to do this.

-- 
Francois Labreque |   //\\    Wear an ASCII ribbon!
    flabreque     |  ||  ||   
        @         |   \\//    Support the campain
   videotron.ca        \\     against HTML e-mail
                      //\\    and news!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.