POV-Ray : Newsgroups : povray.binaries.animations : 30 second TV spot: Exploding blocks : Re: 30 second TV spot: Exploding blocks Server Time
28 Sep 2024 18:31:28 EDT (-0400)
  Re: 30 second TV spot: Exploding blocks  
From: scam
Date: 10 May 2007 09:15:02
Message: <web.46431abf93ceb65b8728aa0b0@news.povray.org>
"Mike the Elder" <zer### [at] wyanorg> wrote:
> I think it's a nifty effect. (Nicely used in the radio spot as well.) I
> *think* I have an idea of how it works, but if you regard the code as
> something you would be willing to post, it would be appreciated. (If not,
> that would be understandable too - no hard feelings.) It might yield some
> interesting results to apply the same technique to the elements comprising
> two blob objects. Thanks for the look.
>
> Regards,
> Mike C.

Thanks Mike. I'm happy to share the code, however in its current form it is
unintelligible to everyone but myself. I'll clean it up and post it once
the working week is done. Also I may have oversold the algorithm a bit, it
is very simple and not subtle or clever at all.

In short though, here is how the effect works:

1. Divide the beginning object up into blocks: Set a grid resolution then
use the 'inside' function to determine if the points of your grid lie
inside or outside the object. The internal points are of course the block
positions.
2. Make a list of the position vectors of each block: listA
3. Divide the final object up into a list of blocks: listB
4. Sort both lists so that the ones furthest from the origin appear first
(not very subtle!)
5. Write both listA and listB to a file so you don't have to discretize the
beginning and end objects at each step of the animation.

And here's the trick:

6. Translate the blocks from object A with position vector listA[ii] to the
position x*(listA[ii] + listB[ii]) for all ii, where x >= 1
7. Translate the block at x*(listA[ii] + listB[ii]) to position listB[ii]
for all ii

That's the basic idea. In effect it is the coarsest possible way to morph
between two objects, but it still looks kind of cool.

Some of the problems with this approach are: in step 4 no distinction is
made between internal blocks (those which have no face visible form the
outside) and external blocks (when the two objects have different numbers
of blocks the external ones should have a higher priority), blocks will
frequently collide and pass straight through each other, and the objects
need to be roughly the same volume.


Post a reply to this message

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