POV-Ray : Newsgroups : povray.binaries.images : Media trees Server Time
28 Mar 2024 08:42:08 EDT (-0400)
  Media trees (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Thomas de Groot
Subject: Media trees
Date: 13 Dec 2021 11:35:24
Message: <61b7764c@news.povray.org>
Continuing to visit ancient code, this time something that attracted my 
attention years ago: the media trees used by Gilles Tran in his 
MakeCloud application 
http://www.oyonale.com/image.php?code=431&mode=info&section=2003&lang=fr

I took the relevant code out of the application and updated it to POV 
version 3.8 into a tree macro. The result is slightly different from the 
original but very useful (and fast) to be used as background trees in a 
landscape. Maybe I can improve further.

I take the liberty to attach the code here, with the image.

Hope you find it useful.

-- 
Thomas


Post a reply to this message


Attachments:
Download '00-mediatree_test.jpg' (120 KB) Download '00-mediatree_test.pov.txt' (6 KB)

Preview of image '00-mediatree_test.jpg'
00-mediatree_test.jpg

From: Paolo Gibellini
Subject: Re: Media trees
Date: 13 Dec 2021 16:09:34
Message: <61b7b68e$1@news.povray.org>
Il 13/12/2021 17:35, Thomas de Groot ha scritto:
 > Continuing to visit ancient code, this time something that attracted my
 > attention years ago: the media trees used by Gilles Tran in his
 > MakeCloud application
 > http://www.oyonale.com/image.php?code=431&mode=info&section=2003&lang=fr
 >
 > I took the relevant code out of the application and updated it to POV
 > version 3.8 into a tree macro. The result is slightly different from the
 > original but very useful (and fast) to be used as background trees in a
 > landscape. Maybe I can improve further.
 >
 > I take the liberty to attach the code here, with the image.
 >
 > Hope you find it useful.
 >

Wow, fluffy trees! They can lend themselves to many experiments.
Nice work!
   Paolo


Post a reply to this message

From: Thomas de Groot
Subject: Re: Media trees
Date: 14 Dec 2021 02:22:25
Message: <61b84631@news.povray.org>
Op 13/12/2021 om 22:09 schreef Paolo Gibellini:
> 
> Wow, fluffy trees! They can lend themselves to many experiments.
> Nice work!
>    Paolo

Thanks Paolo. I am not entirely done, I think. But yes, there is much 
room for experiments indeed.

-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Media trees
Date: 14 Dec 2021 06:50:00
Message: <web.61b8840a400fcdc51f9dae3025979125@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 13/12/2021 om 22:09 schreef Paolo Gibellini:
> >
> > Wow, fluffy trees! They can lend themselves to many experiments.
> > Nice work!

>
> Thanks Paolo. I am not entirely done, I think. But yes, there is much
> room for experiments indeed.
>
> --
> Thomas

This would obviously be great to make "smoke trees" of the genus Cotinus.

I first discovered these on my commute up Route 287 in NJ when I was working at
(now defunct - thanks, Monsanto) American Cyanamid in the early 90's.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Media trees
Date: 14 Dec 2021 07:50:36
Message: <61b8931c$1@news.povray.org>
Op 14-12-2021 om 12:46 schreef Bald Eagle:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>> Op 13/12/2021 om 22:09 schreef Paolo Gibellini:
>>>
>>> Wow, fluffy trees! They can lend themselves to many experiments.
>>> Nice work!
>>>     Paolo
>>
>> Thanks Paolo. I am not entirely done, I think. But yes, there is much
>> room for experiments indeed.
>>
>> --
>> Thomas
> 
> This would obviously be great to make "smoke trees" of the genus Cotinus.
> 
> I first discovered these on my commute up Route 287 in NJ when I was working at
> (now defunct - thanks, Monsanto) American Cyanamid in the early 90's.
> 

Indeed. Beautiful plants. Shall put them in the ToDo List, Volume 15, 
Page 532... ;-)

-- 
Thomas


Post a reply to this message

From: Mr
Subject: Re: Media trees
Date: 15 Dec 2021 04:15:00
Message: <web.61b9b16a400fcdc516086ed03f378f2@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Continuing to visit ancient code, this time something that attracted my
> attention years ago: the media trees used by Gilles Tran in his
> MakeCloud application
> http://www.oyonale.com/image.php?code=431&mode=info&section=2003&lang=fr
>
> I took the relevant code out of the application and updated it to POV
> version 3.8 into a tree macro. The result is slightly different from the
> original but very useful (and fast) to be used as background trees in a
> landscape. Maybe I can improve further.
>
> I take the liberty to attach the code here, with the image.
>
> Hope you find it useful.
>
> --
> Thomas

Very exciting! the shading is spot on !


Post a reply to this message

From: Kenneth
Subject: Re: Media trees
Date: 15 Dec 2021 05:05:00
Message: <web.61b9ba19400fcdc54cef624e6e066e29@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
>
> Thanks Paolo. I am not entirely done, I think. But yes, there is much
> room for experiments indeed.
>

That is clever and effective. I have always been interested in the possibilities
of using 'solid' (or semi-solid) media for creating interesting shapes.
Currently, I'm working on using POV-Ray's 'object' pattern and filling that with
media, along with applying an image_map for the media's colors. The code is
complex and uses functions, which is why I haven't posted about it yet; it needs
some detailed comments added, to explain how it works.

Anyway...

Examining your code, it looks like there are two different color schemes for the
trees, in  #macro Tree(rd_)...

  #local R1 = rd_;
  #local R2 = RRand(0.0, 1.0, R1);
  #if (R1 < 0.2) // yellowish-green
     #local C_Media = <RRand(180, 200, R1), RRand(180, 200, R1), 90>/255;
  #else // blue-ish
    #local C_Media = <RRand(50, 100, R1), RRand(155, 200, R1), 87>/255;
  #end

...... but when the macro is actually called later in the 'woods' #while loop to
create the many trees, it's like this (in two places):
       Tree(0)  // zero

If I understand the code correctly, that imposes the same 'initial'
yellowish-green color on *all* the trees-- because 0.0 is always less than
         #if (R1 < 0.2)
in the macro. To get a good distribution of the TWO colors, I used
         Tree(rand(rd))
for both of the macro calls in 'woods'. Or maybe some version of RRand(...)
would work better.

----------
[Somewhat off-topic):
I am also curious about RRand(...) itself, and how it is used here. If rd_ (i.e.
R1) in the 'Tree' macro *is* 0.0, than that is used as the random-number stream
for RRand(...). I didn't know that 0.0 could be successfully used for that-- or
even for seed(0). I have always used at least 1. But zero does work!

I guess I need to take a look at 'math.inc', to see how RRand() is actually
constructed. And to re-read the docs concerning seed() and rand() too  ;-)


Post a reply to this message

From: Kenneth
Subject: Re: Media trees
Date: 15 Dec 2021 05:35:00
Message: <web.61b9c4b0400fcdc54cef624e6e066e29@news.povray.org>
BTW, I was genuinely surprised that a media/samples count of only 1 would
produce such a visually-appealing result! And a reasonably fast render, too.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Media trees
Date: 15 Dec 2021 08:23:33
Message: <61b9ec55$1@news.povray.org>
Op 15-12-2021 om 11:34 schreef Kenneth:
> BTW, I was genuinely surprised that a media/samples count of only 1 would
> produce such a visually-appealing result! And a reasonably fast render, too.
> 
I didn't even think about that really ;-) I guess it is mainly the 
absorption which does the trick...

-- 
Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Media trees
Date: 15 Dec 2021 08:33:18
Message: <61b9ee9e$1@news.povray.org>
Op 15-12-2021 om 11:00 schreef Kenneth:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>>
>> Thanks Paolo. I am not entirely done, I think. But yes, there is much
>> room for experiments indeed.
>>
> 
> That is clever and effective. I have always been interested in the possibilities
> of using 'solid' (or semi-solid) media for creating interesting shapes.
> Currently, I'm working on using POV-Ray's 'object' pattern and filling that with
> media, along with applying an image_map for the media's colors. The code is
> complex and uses functions, which is why I haven't posted about it yet; it needs
> some detailed comments added, to explain how it works.
> 
> Anyway...
> 
> Examining your code, it looks like there are two different color schemes for the
> trees, in  #macro Tree(rd_)...
> 
>    #local R1 = rd_;
>    #local R2 = RRand(0.0, 1.0, R1);
>    #if (R1 < 0.2) // yellowish-green
>       #local C_Media = <RRand(180, 200, R1), RRand(180, 200, R1), 90>/255;
>    #else // blue-ish
>      #local C_Media = <RRand(50, 100, R1), RRand(155, 200, R1), 87>/255;
>    #end
> 
> ...... but when the macro is actually called later in the 'woods' #while loop to
> create the many trees, it's like this (in two places):
>         Tree(0)  // zero
> 
yeah... there are still a couple of bugs in the code which I have not 
yet squashed under my heels. Left overs from Gilles, wild mindless 
changes by me, lack of dried frog pills, you name them.

> If I understand the code correctly, that imposes the same 'initial'
> yellowish-green color on *all* the trees-- because 0.0 is always less than
>           #if (R1 < 0.2)
> in the macro. To get a good distribution of the TWO colors, I used
>           Tree(rand(rd))
> for both of the macro calls in 'woods'. Or maybe some version of RRand(...)
> would work better.
> 
> ----------
> [Somewhat off-topic):
> I am also curious about RRand(...) itself, and how it is used here. If rd_ (i.e.
> R1) in the 'Tree' macro *is* 0.0, than that is used as the random-number stream
> for RRand(...). I didn't know that 0.0 could be successfully used for that-- or
> even for seed(0). I have always used at least 1. But zero does work!
> 
> I guess I need to take a look at 'math.inc', to see how RRand() is actually
> constructed. And to re-read the docs concerning seed() and rand() too  ;-)
> 
I love RRand! you have a fine control over the range within which you 
want your random number to be. For me, who suffers from some mild 
dyscalculia, things remain much clearer. :-/


-- 
Thomas


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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