|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Flowers randomly placed upon a height_field using trace(). Still needs
tweaking, as the flowers are running into each other.
--
Dan
GoofyGraffix.com
Post a reply to this message
Attachments:
Download 't0120033.png' (286 KB)
Preview of image 't0120033.png'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Flowers randomly placed upon a height_field using trace(). Still needs
> tweaking, as the flowers are running into each other.
>
>
> ------------------------------------------------------------------------
>
I suggest 3 options for your colliding flowers:
- change the random seed.
- slightly increase the spacing of the flowers. Just miltiply the
horizontal locations by 1.03-1.05 before tracing.
- add an exclusion cylinder centered around each flower, binded in an
union. The cylinders radius will dictate the minimum distance between
two flowers. You perform an insideness test on that union before you
place a new flower.
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Alain wrote:
> I suggest 3 options for your colliding flowers:
> - change the random seed.
> - slightly increase the spacing of the flowers. Just miltiply the
> horizontal locations by 1.03-1.05 before tracing.
> - add an exclusion cylinder centered around each flower, binded in an
> union. The cylinders radius will dictate the minimum distance between
> two flowers. You perform an insideness test on that union before you
> place a new flower.
>
>
> Alain
>
Option 1 may fix the currently colliding flowers, but may create new
collisions to take their place.
Option 3 is part of a solution I've got working in the back of my brain
(see my latest blog post on my website). For most scenes in my movie,
the flowers will either be behind a wall of focal blur or zipping past
the camera fairly quickly, so I may not worry too much about collisions.
Thanks for the suggestions :)
--
Dan
GoofyGraffix.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Alain wrote:
>> I suggest 3 options for your colliding flowers:
>> - change the random seed.
>> - slightly increase the spacing of the flowers. Just miltiply the
>> horizontal locations by 1.03-1.05 before tracing.
>> - add an exclusion cylinder centered around each flower, binded in an
>> union. The cylinders radius will dictate the minimum distance between
>> two flowers. You perform an insideness test on that union before you
>> place a new flower.
>>
>>
>> Alain
>>
>
> Option 1 may fix the currently colliding flowers, but may create new
> collisions to take their place.
>
> Option 3 is part of a solution I've got working in the back of my brain
> (see my latest blog post on my website). For most scenes in my movie,
> the flowers will either be behind a wall of focal blur or zipping past
> the camera fairly quickly, so I may not worry too much about collisions.
>
> Thanks for the suggestions :)
>
Effectively, in situations like those, you can afford to be lenient
about collisions.
And, looking into some real world situations, there are cases of
colliding flowers. The only thing is that the petals never intersect but
pass between those of neiboring flowers.
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I wrote a collision macro a while back,
you could populate an array with the flowers
and check that they don't collide. The rez
number could be quite small (faster) since it
doesn't matter too much if the flowers just
touch a bit.
#include "rand.inc"
#macro collision(A B rez)
#local result = false;
#if (((min_extent(A).x > max_extent(B).x ) |
(min_extent(B).x > max_extent(A).x ) |
(min_extent(A).y > max_extent(B).y ) |
(min_extent(B).y > max_extent(A).y ) |
(min_extent(A).z > max_extent(B).z ) |
(min_extent(B).z > max_extent(A).z ))=false)
#local AB = intersection{object{A} object{B}};
#local Mn = min_extent(AB);
#local Mx = max_extent(AB);
#local S1 = seed(1);
#local cnt = 0;
#while ((result = false) & (cnt < rez))
#local Pt = VRand_In_Box(Mn, Mx, S1);
#local Norm = <0,0,0>;
#local Hit = trace(AB,<Pt.x,Mn.y-0.1,Pt.z>,y,Norm);
#if (vlength(Norm)!=0)
#local result = true;
#else
#local Hit = trace(AB,<Mn.x-0.1,Pt.y,Pt.z>,x,Norm);
#if (vlength(Norm)!=0)
#local result = true;
#else
#local Hit = trace(AB,<Pt.x,Pt.y,Mn.z-0.1,>,z,Norm);
#if (vlength(Norm)!=0)
#local result = true;
#end
#end
#end
#local cnt = cnt + 1;
#end
#end
(result)
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Another option is to generate them without collision in the
first place. Instead of placing them at random location, go
through a grid of points with twice the necessary spacing and
decide randomly whether to place an object (or semi-randomly,
you can control the probability using a pattern function).
To avoid too regular placing, you can then add some random
offset or turbulence to the grid position (which is why you
need more than the maximum spacing in the initial grid).
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks for all the good ideas. What's probably going to happen is, for
shots with the flowers playing a prominent visual role, the flowers will
be manually placed and tweaked to avoid any petal/leaf collision.
Flowers relegated to background status behind a wall of focal blur...
well, we'll just leave them to chance ;) As I've mentioned before, I
don't want to spend a thousand hours to cure a ten-second headache...
--
Dan
GoofyGraffix.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |