|
|
> 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
|
|
|
|
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
|
|