|
|
I'm sorry to disappoint you, but the boxes do
collide and intersect. What I've done is just
create a random position in a sphere with
the following code:
#declare R=seed(1);
#declare Pos=vnormalize(<rand(R)*2-1,rand(R)*2-1,rand(R)*2-1>);
Then, I can just multiply Pos with some float (again
random chosen from a specific range, like .5 to 2 or
such). When doing this with sin-waves (which I've randomly
shifted forward), you get what you see in the animation. I've
done it like this:
#declare Float=sin(radians(360*rand(R)+360*clock));
Now, float is a value ranging from -1 to 1. Adding 1 and
dividing by two gets me 0 to 1 range, which I can easily
use for Pos.
Now, that information probably wasn't really needed since you
were after collision-avoidance, but I thought I'd explain it anyway.
Perhaps it's still of use.
Regards,
Tim
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
> Hey Tim!
>
> I'm very interesting in the code for calculating the movement of the
> objects. How do you avoid collisions?
> Would you mind sharing the code?
>
> TIA,
> Florian
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 15.07.2003
Post a reply to this message
|
|