POV-Ray : Newsgroups : povray.general : Collision checking? : Re: Collision checking? Server Time
3 Aug 2024 10:19:55 EDT (-0400)
  Re: Collision checking?  
From: Tim Nikias v2 0
Date: 3 Mar 2004 08:59:47
Message: <4045e4d3$1@news.povray.org>
> How do you guys do it?

Well, I start with three rays and shoot along the direction which I
calculate from
(new_position - former_position)
One ray is shot from the center of the particle, the other in front of the
particle along the velocity-vector and one from below the particle, along
the gravity-vector.
Additionally, when a particle moves, I spread a User-Defined amount of
trace-origins on the frontern hemisphere of the particle.

From all these samples I choose the one closest to any origin and check for
collisions from there. To properly place the particle, I keep track where
the sample-origin is in relation to the particle's center and add that
relation to the collision-point.

Of course, there are still inaccuracies, but as long as you trace samples
there's always a possibility that the samples don't hit the object. Same
goes for raytracing, BTW, when rays shoot just aside of small objects, they
won't be visible in the final image.

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de


Post a reply to this message

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