POV-Ray : Newsgroups : povray.general : Some aid in physics required... : Re: Some aid in physics required... Server Time
3 Aug 2024 20:15:33 EDT (-0400)
  Re: Some aid in physics required...  
From: Rune
Date: 25 Feb 2004 04:27:49
Message: <403c6a95$1@news.povray.org>
If I understand you right, then things happen like this in your system:

On impact, the particle is moved to the surface, so it is practically 0
units away from the surface. After this, when you calculate the new
position, and find out that there is a surface between the old and the
new position, you use linear interpolation to find the impact time.
Since the old position was about zero distance from the surface, the
interpolation will tell you that the new impact happened at the SAME
time as the old impact. Thus you get extremely frequent impacts as you
describe.

I must admit that I think the idea of switching between two modes to
solve the problem is a rather clumsy hack, especially the ways you have
to "detect" when to switch.

A better solution in my opinion is to not create a new time-step every
time an impact occurs, but instead allow for several impacts in the same
time-step. However, gravity will only be added once every time-step, so
in most cases you will never have more than one impact per time-step.
This way, you can use your normal algorithm to control the lengths of
time-steps dependent on distance, regardless of impacts, and thus you
can have pretty large time-steps also when a particle is sliding along a
surface. (The cases where you will still have many impacts are for
example those where your particle gets caught in a v-like-shape, but
those situations are not that frequent.)

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com **updated Jan 29**
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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