POV-Ray : Newsgroups : povray.binaries.images : Do you think it should work this way? (scatter code soon -maybe-) : Do you think it should work this way? (scatter code soon -maybe-) Server Time
17 Aug 2024 02:26:20 EDT (-0400)
  Do you think it should work this way? (scatter code soon -maybe-)  
From: JRG
Date: 21 Nov 2001 16:17:48
Message: <3bfc19fc@news.povray.org>
Ok, I was going to put the macro into my web site (yes, Christoph, my ISP
offered illimitated web space and I didn't even suspect that :-|  doh!),
when I came upon a problem showing when you place too many objects very
close to each other.
In the following images, the coins are placed with a non-random spiral loop:

Here's how the problem manifested itself:
http://digilander.iol.it/jrgpov/images/coins1.jpg

As you can see, every coin close to the centre of the spiral is placed on
the previous one, and this pile grows until some coins touch the previous
ones only in one point and then float in the air: that's due to the
algorithm, which supposes that, once rotated properly, the object touches at
least three points of the *land*. If this doesn't occur the object is
rotated in a wrong way and it floats in the air.

So I added some code to check if the object really touches those three
points, and if not it slightly moves the object from its position.
Here's how the image looks with this addiction:
http://digilander.iol.it/jrgpov/images/coins2.jpg

Yet, the pile has grown too much. A physically correct macro would have
checked whether the weigth of the pile makes it fall or not. To avoid this
problem I add the possibility to define a max_height float, which checks
that the object position is not too distant from the ground.
Here's how the final image looks:
http://digilander.iol.it/jrgpov/images/coins3.jpg

The problem is that these workarounds *break* the spiral shape (which isn't
a true problem if you're using pseudo-casual positions).

What do you think, do these workarounds do their job? Again including
physics would be very slow and difficult to implement: you would have to
take into account the already placed objects as well, unless you want to get
wrong results like the too high pile of coins shown before.
BTW any suggestion in this direction is welcome :)

So, I think the macro will be posted within two days maximum (I have to
write some sample scenes and, what is harder for those who, like me, doesn't
know English too well, a brief documentation).

Cheers,


--
Jonathan.

Home Page: http://digilander.iol.it/jrgpov/


Post a reply to this message

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