POV-Ray : Newsgroups : povray.binaries.animations : Now the balls also slide! [MPG1, 786kB] : Re: Now the balls also slide! [MPG1, 786kB] Server Time
18 Jul 2024 18:28:36 EDT (-0400)
  Re: Now the balls also slide! [MPG1, 786kB]  
From: Tim Nikias v2 0
Date: 9 Mar 2004 19:30:17
Message: <404e6199@news.povray.org>
> 2. If the new position indicates a collision, the previous position is
> restored (so basically particles _can't_ intersect with an object). The
> next happens:
>
> a) speed is directed away from the surface taking the damping into
> account: this gives basic bounces.
> b) particle is moved along the surface: this allows rolling and the
> bounces are also more accurate, still not perfect though. If I want them
> perfect I would have to find the _exact_ moment of collision.
> c) gravity affects the speed along the surface: this allows the increase
> in speed when rolling - also the accuracy of bounces increase.

But you surely have to calculate where the particle hits the object, don't
you? Either I'm missing something here, or you're missing some really big
issue. Just take the following:
A particle flying with 20mph. It'll hit a wall in 50 seconds, but you jump
and calculate 2 minutes. So, instead of rebouncing off the surface, you just
take the exisiting position and reverse the direction of velocity, so it'll
fly another direction. Maybe it'll hit another surface there to, so you
reverse the velocity once again... That it should have actually dropped a
few meters until it hit the first wall is left out?

> By "lucky" I mean that there seems to be no bugs and everything seems to
> work as expected after I implemented 2.b and 2.c. BTW, have you tried
> how Cristophs particle system/MegaPov handles rolling/sliding? Just
> curious. At least it is a lot faster as it is hard coded.

Never looked at it, but just ask Christoph, he'll surely know. :-)

> Now I have only planes as environment and I check collisions by shooting
> a ray towards every plane. This obviously is accurate but a bad thing to
> do when there are many objects. Next I have to make the environment as a
> one single union and shoot proper rays towards it. Accuracy decreases
> but I can use as complex environment as I want.

How does accuracy decreas when using a ray per object or one ray total per
union? Internally, I think POV-Ray just shoots the rays at the different
union-components, but returns only the closest hit. It's faster than doing
that yourself, and the comparison in SDL might be less accurate than what
POV-Ray is capable of internally, but surely not that much?

Since you're now shooting a ray at every plane individually, I expect you're
shooting them parallel to the plane's surface-normals, and thus maintain
that a particle won't intersect a plane because you know it's radius and can
then easily move it along the normal so that it won't intersect the plane.
This technique will run into problems with other objects, where the closest
point to the object isn't found with some arbitrary normal that easily.

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