POV-Ray : Newsgroups : povray.advanced-users : An idea about plant growth with a L-System and the mesh-camera Server Time
15 Oct 2026 06:40:44 EDT (-0400)
  An idea about plant growth with a L-System and the mesh-camera (Message 1 to 16 of 16)  
From: MichaelJF
Subject: An idea about plant growth with a L-System and the mesh-camera
Date: 2 Jan 2013 12:05:01
Message: <web.50e4684617e3ce9f78ca74630@news.povray.org>
Hi all around,

I just read a paper about growing plants to light and came up with a very silly
idea. The paper is "A Simple but Effective Algorithm to Model the Competition of
Virtual Plants for Light and Space" by William Van Haevre and Philippe Bekaert
(2003). One can find it with google easily. They use an open L-System to model
the plant by calculating special photons to determine the direction the plant
will grow. My idea is to simulate a L-System with the animation feature of POV
(writing the actual string to file, read it in the next iteration, perform the
L-System rules and write it out again). To determine the direction of growth I
will not use this complicated photon issue but simply look through the "eyes" of
the seedlings (branches) using the mesh-cam, distribution type 3, evaluating the
brightesst spot with eval_pigment and use this as the new direction. O.k. this
is a very brief scetch of my idea. My question here is: Has someone of you
implemented a L-System with POV so far. If I have to invent the wheel I will do,
but if someone else did it some time ago, I would like to learn about it. My
searches here yielded no hits unfortunatelly.

Best regards,
Michael


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 2 Jan 2013 13:05:01
Message: <web.50e475a679737bf578ca74630@news.povray.org>
BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
and I the only users here to play around with it?

Best regards,
Michael


Post a reply to this message

From: Christian Froeschlin
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 2 Jan 2013 19:49:04
Message: <50e4d580$1@news.povray.org>
MichaelJF wrote:

> BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
> and I the only users here to play around with it?

It's mighty but also not trivial to use (or even understand, I'm not
sure I fully understood what all the modes do myself). Also I gathered
it is mostly useful in elaborate multipass processes. Given that most
hobbyists are less dedicated I think the number of potential users
is smaller than you expect.

Not to mention you also need some kind of mesh. If you don't use
modellers and treat povray as a programming language that turns code
into images, then the mesh cam is a remote feature.


Post a reply to this message

From: Paolo Gibellini
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 3 Jan 2013 03:33:43
Message: <50e54267$1@news.povray.org>
>MichaelJF  on date 02/01/2013 18.03 wrote:
> My question here is: Has someone of you
> implemented a L-System with POV so far

Years ago, for a irtc entry, I realized a very basic L-System parser.
The code is not well documented, but you can found it in p.b.s.
Paolo


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 3 Jan 2013 13:05:01
Message: <web.50e5c81879737bf52a8871fd0@news.povray.org>
Paolo Gibellini <p.g### [at] gmailcom> wrote:
> >MichaelJF  on date 02/01/2013 18.03 wrote:
> > My question here is: Has someone of you
> > implemented a L-System with POV so far
>
> Years ago, for a irtc entry, I realized a very basic L-System parser.
> The code is not well documented, but you can found it in p.b.s.
> Paolo

Thanks a lot, but unfortunatelly I can only find a broken link at an Australian
server. Can you remember the picture or the topic? Basic could be suffient for
me, since I intent only a proof of concept at the moment.

Best regards,
Michael


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 3 Jan 2013 13:35:00
Message: <web.50e5ce9179737bf52a8871fd0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> It's mighty but also not trivial to use (or even understand, I'm not
> sure I fully understood what all the modes do myself).
Yes, that is true. I think I understand the distribution type 3, which is a
little bit like looking through the object like an eye. But you need not only a
mesh, it must be uv-mapped too. And this uv-mapping can not have overlapping
areas. A ghost I hunted down a while. For texturing purposes overlapping areas
are no problem.

> Also I gathered
> it is mostly useful in elaborate multipass processes. Given that most
> hobbyists are less dedicated I think the number of potential users
> is smaller than you expect.

And yes again, with my experiments with using dynamic hair from poser I had some
1000 objects which needed an individual occlusion map baking. All had to be
sticked together to yield the final image.
>
> Not to mention you also need some kind of mesh. If you don't use
> modellers and treat povray as a programming language that turns code
> into images, then the mesh cam is a remote feature.

In some cases I use POV to create uv-mapped meshes first and then apply the
meshcam e.g. for occlusion map baking. An idea I used for long years with my
statistical software and recogniced that it is possible with POV too by looking
at Gilles makegrass macros some years ago. Yes, you need some experience with
interpreting languages (must not be POV) and their possibilties to come up with
such ideas.

Best regards,
Michael


Post a reply to this message

From: Paolo Gibellini
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 7 Jan 2013 04:09:11
Message: <50ea90b7$1@news.povray.org>
> Thanks a lot, but unfortunatelly I can only find a broken link at an Australian
> server. Can you remember the picture or the topic? Basic could be suffient for
> me, since I intent only a proof of concept at the moment.
>
> Best regards,
> Michael
>
>
I've posted the code in p.b.s. (i.e. povray.binaries.scene-files):
http://news.povray.org/povray.binaries.scene-files/thread/%3C50e54231%40news.povray.org%3E/
;-)
Paolo


Post a reply to this message

From: Cousin Ricky
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 8 Jan 2013 11:40:01
Message: <web.50ec4aca79737bf578641e0c0@news.povray.org>
"MichaelJF" <mi-### [at] t-onlinede> wrote:
> BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
> and I the only users here to play around with it?

Probably because I can't make heads or tails of what it even means.


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 8 Jan 2013 17:29:29
Message: <50ec9dc9$1@news.povray.org>
El 08/01/13 17:35, Cousin Ricky escribió:
> "MichaelJF" <mi-### [at] t-onlinede> wrote:
>> BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
>> and I the only users here to play around with it?
>
> Probably because I can't make heads or tails of what it even means.
>

  It means that you can use a mesh surface as a viewing port, or 
something like that... to make a gross analogy, think on a point light 
and a emitting surface: now replace the light rays for camera rays and 
you got it. :)

--
Jaime


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 9 Jan 2013 16:20:00
Message: <web.50eddedf79737bf532256c560@news.povray.org>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
> El 08/01/13 17:35, Cousin Ricky escribió:
> > "MichaelJF" <mi-### [at] t-onlinede> wrote:
> >> BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
> >> and I the only users here to play around with it?
> >
> > Probably because I can't make heads or tails of what it even means.
> >
>
>   It means that you can use a mesh surface as a viewing port, or
> something like that... to make a gross analogy, think on a point light
> and a emitting surface: now replace the light rays for camera rays and
> you got it. :)
>
> --
> Jaime

Yes, I interpret the mesh cam (distribution type 3) in a way like looking
through the "eyes of an object". What can be seen from the surface of an object
(the mesh the mesh camera represents)? Is there light or is there darkness? My
idea here was then, what can a sprout see, where is the most light and then grow
in this direction. So far I have only a meta program for the "animation" feature
of pov to yield results here. And I'm confident that it will work. But first I
will go for the next entry at Tina-Chep, I hope you can forgive me. As soon as I
have results to this isuue here, I will post them.

Best regards,
Michael


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 9 Jan 2013 16:25:00
Message: <web.50eddf8279737bf532256c560@news.povray.org>
Paolo Gibellini <p.g### [at] gmailcom> wrote:
> > Thanks a lot, but unfortunatelly I can only find a broken link at an Australian
> > server. Can you remember the picture or the topic? Basic could be suffient for
> > me, since I intent only a proof of concept at the moment.
> >
> > Best regards,
> > Michael
> >
> >
> I've posted the code in p.b.s. (i.e. povray.binaries.scene-files):
>
http://news.povray.org/povray.binaries.scene-files/thread/%3C50e54231%40news.povray.org%3E/
> ;-)
> Paolo

Thanks a lot,
now I have it, I will investigate it tomorrow. I'm a little bit tired at the
moment and will give you response ASAP.

Best regards,
Michael


Post a reply to this message

From: Paolo Gibellini
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 10 Jan 2013 03:43:56
Message: <50ee7f4c@news.povray.org>
> Thanks a lot,
> now I have it, I will investigate it tomorrow. I'm a little bit tired at the
> moment and will give you response ASAP.
>
> Best regards,
> Michael
>
>
You're welcome,
If you plan to use the code I can clean it a bit...
;-)
Paolo


Post a reply to this message

From: Mr
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 14 Jan 2013 08:10:01
Message: <web.50f4036d79737bf5ed29e82f0@news.povray.org>
"MichaelJF" <mi-### [at] t-onlinede> wrote:
> BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
> and I the only users here to play around with it?
>
> Best regards,
> Michael

There is a baking feature in Blender to POV-Ray exporter that uses the mesh
camera. It's currently commented out as there are other priorities, but anyone
wanting to play with it can access it in the official Blender package.

The idea of using it for plant growth sounds fun I can't wait to play with the
result :)


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 14 Jan 2013 14:40:01
Message: <web.50f45de179737bf530fe50f30@news.povray.org>
Paolo Gibellini <p.g### [at] gmailcom> wrote:
> > Thanks a lot,
> > now I have it, I will investigate it tomorrow. I'm a little bit tired at the
> > moment and will give you response ASAP.
> >
> > Best regards,
> > Michael
> >
> >
> You're welcome,
> If you plan to use the code I can clean it a bit...
> ;-)
> Paolo

Hi Paolo,

tonight I found the time to look at your code finally. I think it is a good
starting point for my purposes. I never would have came up with the simple idea
to store the left and the right hand side of the productions into corresponding
arrays. This gives room for improvement. I think it is possible to extend your
str_pos and str_replace macros to accept strings for the parameter "caraterre"
which would make simple context-sensitive grammars possible. Since I need an
extension into the third dimension and a so called "open parameter" (to
determine the next direction with the mesh cam), which is handled between every
iteration of your parse_string macro with additional code, I propose to leave
the changes to me (since I'm not very good in explaining my ideas to others).
But I thank you very much for the code and your kind offer.


Best regards,
Michael


Post a reply to this message

From: MichaelJF
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 14 Jan 2013 15:40:01
Message: <web.50f46d1a79737bf530fe50f30@news.povray.org>
"Mr" <nomail@nomail> wrote:
> "MichaelJF" <mi-### [at] t-onlinede> wrote:
> > BTW The mesh-cam is a very useful and mighty approvement to POV. Why are Jaime
> > and I the only users here to play around with it?
> >
> > Best regards,
> > Michael
>
> There is a baking feature in Blender to POV-Ray exporter that uses the mesh
> camera. It's currently commented out as there are other priorities, but anyone
> wanting to play with it can access it in the official Blender package.
>
> The idea of using it for plant growth sounds fun I can't wait to play with the
> result :)

I have to take my time for this project, so please be a little bit patient. I'm
interested in the results for myself since the idea is a little bit insane. But
I think it can work. And I love insane ideas...

Paolos code gave me some ideas for simplifications I would not came up having
not studied it. This may speed up the project (but make it more simple, of
course). But at the moment I'm only interested in testing the possibility. And
not in realistic growing trees with elabourated barks and leafs. If I can extend
Paolos approach into the third dimension and determine the direction of growth
with the meshcam in a simple animation (made with POV of course, I have no idea
about blender), I will be content. But having only two or three hours in the
evenings for such projects, it will take a while.

Best regards,
Michael


Post a reply to this message

From: Paolo Gibellini
Subject: Re: An idea about plant growth with a L-System and the mesh-camera
Date: 15 Jan 2013 07:35:38
Message: <50f54d1a$1@news.povray.org>
>MichaelJF  on date 14/01/2013 20.35 wrote:
> Hi Paolo,
>
> tonight I found the time to look at your code finally. I think it is a good
> starting point for my purposes. I never would have came up with the simple idea
> to store the left and the right hand side of the productions into corresponding
> arrays. This gives room for improvement. I think it is possible to extend your
> str_pos and str_replace macros to accept strings for the parameter "caraterre"
> which would make simple context-sensitive grammars possible. Since I need an
> extension into the third dimension and a so called "open parameter" (to
> determine the next direction with the mesh cam), which is handled between every
> iteration of your parse_string macro with additional code, I propose to leave
> the changes to me (since I'm not very good in explaining my ideas to others).
> But I thank you very much for the code and your kind offer.
>
>
> Best regards,
> Michael
>
>
>
It is an old work but I'm fascinated by L-Systems and I'm glad that the 
code can be reused.
I've translated in English the names of the variables and added a couple 
of comments. You can find the updated source in p.b.s.

Regarding the 3-d extension, there is an example here:
http://math.stackexchange.com/questions/123642/representing-a-3d-hilbert-curve-as-an-l-system
In the example they introduced Yaw, Pitch and Roll.

Hope it helps,
;-)
    Paolo


Post a reply to this message

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