|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Looks strange. Somehow, the blue marbles warp between sorts of appearance or
such. Aside of that, you still haven't told us about the technique you're
using, which makes it kinda awkward to judge it properly. Perhaps it's just
not YOU making the step and check, but some external program? No mention of
parsing times either, and rendering etc. Well... Keep it a secret, if you
want to...
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: tim.nikias (@) gmx.de
> Now in 3D. Greater speed, accuracy, and number of elements possible
> without "step and check." Narrow z dimension to give more collisions.
>
> -Shay
>
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23.09.2003
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
For simply shaped objects, doing 'perfect' collision detection without multiple time
steps isn't too
difficult.
If you know the velocity and position of two spheres, the exact time that they will
collide (if they
do) is given by a solution to a quadratic equation. Once you have the exact time, you
know the exact
position the spheres are in when they just touch. Its then quite easy to calculate the
force impulse
between them, and their resulting motion.
A general algorithm for doing this would compare each sphere with each other sphere,
and solve the
collision quadratic for each pair of spheres. Some will collide at some point in the
future, some
won't (e.g. if they are going away from each other). If you make a list of all these
possible future
colisions and find the one that is soonest, you can advance the time to that point
(i.e. move all
the spheres by the difference in time between now and the soonest collision) and
calculate the
collision for the two spheres involved in the soonest collision, updating the two
velocities of
those spheres appropriately. Then just run the algorithm again to find the next
collision - find
which is the soonest collision, with the situation of the spheres altered as it is.
This is fairly easy in 2D - the maths to find at exactly what time the spheres
intersect is a bit
tricker in 3D, but its the same concept. Where this gets very difficult (or at least
very fiddly) is
where the objects are not simple shapes.
-Chris
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chris Johnson wrote:
| For simply shaped objects, doing 'perfect' collision detection
| without multiple time steps isn't too difficult....
What about gravity? :)
-Shay
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
The quadratic I was talking about (for 2D):
d = sum of radii of the two spheres
dvx = difference in sphere x-velocities (e.g. xv1-xv2)
dvy = difference in sphere y-velocities
dx = difference in sphere x-positions
dy = difference in sphere y-positions
t = time
The quadratic is:
You need to find the solution that is
since the other solution:
is the time at which the balls (had they gone through each other) would separate the
'other side' of
the collision. Note that if the value of t is negative, it means that the collision
has 'already
happened' - i.e. the spheres are going away from each other. Since they won't collide
again on their
present courses, this case can be ignored.
-Chris
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-[What about gravity?]-
Whoops... how irritating. Its still possible to solve exactly for parabolic
movement,as you must
know :) - though a bit more complex than the equation I've given in the post, I guess.
Actually, I've just thought of a way which might make gravity rather simple to code -
since the
collisions between the balls themselves aren't affected by gravity (the system of
balls is
accelerating as a whole), the only think we need to worry about is stationary objects,
which will
appear (from the balls point of view) to be accelerating upwards. Hmm...
-Chris
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Oh, I see. That's what my particle system does to avoid I/O, but I didn't
implement particle-particle-interaction, cause parsing times would rise even
more. Given my experience with that kind of approach, I'd say that Shay uses
I/O to only track interactions within a given timeframe (which, depending on
velocities, may easily rule out several of the interactions that would
theoretically be possible). Aside of that, parsing times will sky-rocket the
higher the particle count (quadratic) unless some clever switches take care
of ruling interactions out better than calculating it.
Hey, Shay, how do you calculate interaction between two parabels? Like, when
two particle drop due to gravity, but also have a sideway-velocity? I'm
interested in the math behind this.
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: tim.nikias (@) gmx.de
> The quadratic I was talking about (for 2D):
>
> d = sum of radii of the two spheres
> dvx = difference in sphere x-velocities (e.g. xv1-xv2)
> dvy = difference in sphere y-velocities
> dx = difference in sphere x-positions
> dy = difference in sphere y-positions
> t = time
>
> The quadratic is:
>
> You need to find the solution that is
> since the other solution:
> is the time at which the balls (had they gone through each other) would
separate the 'other side' of
> the collision. Note that if the value of t is negative, it means that the
collision has 'already
> happened' - i.e. the spheres are going away from each other. Since they
won't collide again on their
> present courses, this case can be ignored.
>
> -Chris
>
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23.09.2003
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Shay" <sah### [at] simcopartscom> wrote in news:3f798da6@news.povray.org:
> Now in 3D. Greater speed, accuracy, and number of elements possible
> [...]
Interesting, but it doesn't look very 3D. How about using a perspective
camera and giving the viewer some sense of depth?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
-[how do you calculate interaction between two parabels?]-
If the parabolas have the same curvature (e.g. same acceleration downwards due to
gravity), the
objects will be in straight lines moving relative to each other, so the straight line
code will do.
Just on the back of an envelope (literally) I think I've got the general idea of
parabola
interstections with accelerations that aren't the same - I haven't checked it yet. If
you subtract
one parabola quadratic from the other to get a parabola of relative motion. This then
intersects a
circle, representing the sum of the radii. The parabola can be shifted to make the
circle lie on the
origin, i.e.
this gives a quartic, which can be solved exactly, but its a bit more difficult than a
quadratic. A
quartic makes sense, because there can be up to four intersections of the parabola
with the circle
(e.g. something like 100-1000x^2 and r=50)
I haven't worked the details of this one out yet - I think the values of a, b, c and d
are likely to
be fairly long expressions in themselves.
-Chris
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Sorry about the late post, I just started reading the binaries groups
again.
On Wed, 1 Oct 2003 01:39:51 +0100, "Chris Johnson"
<chr### [at] chris-jcouk> wrote:
>since the collisions between the balls themselves aren't affected by gravity
>(the system of balls is accelerating as a whole)
The system of balls is under constant *acceleration*, not constant
velocity, thus it is not an inertial system and your assumption is
incorrect.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |