POV-Ray : Newsgroups : povray.general : Collision checking? Server Time
2 Nov 2024 15:26:07 EDT (-0400)
  Collision checking? (Message 1 to 3 of 3)  
From: Severi Salminen
Subject: Collision checking?
Date: 3 Mar 2004 08:39:13
Message: <4045e001$1@news.povray.org>
How do you guys do it? In my particle system (see YaPS, in p.b.a) I have 
only balls and planes. I check the collision by shooting a ray 
perpendicularly towards a plane. This gives the most accurate results as 
that point is allways the closest point to the ball but how do you 
handle more complex objects (enviroment objects that do not move)? Do 
you just shoot a ray to the velocity direction not even trying to be 
most accurate? Doesn't it cause errors as part of the ball might still 
hit an object?

Severi S.


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Collision checking?
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

From: Warp
Subject: Re: Collision checking?
Date: 3 Mar 2004 10:03:13
Message: <4045f39e@news.povray.org>
In the scanline rendering world, where everything is made of triangles,
collision checking is done by testing the intersection of triangles.
Using bounding box hierarchies and other optimization methods this can
be done fairly quickly and accurately.

  But as always, when we have only mathematical surfaces, not triangle
tesselations, problems arise.

  One solution would be, thus, tesselating all your objects (internally,
no need to render the tesselated objects) and perform the collision
checking using some known algorithm.

  Of course tesselating a free scene is a problem in itself...

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

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