Jump to content
Sign in to follow this  
Stremik

L-System madness

Recommended Posts

Can someone show me please how to properly use the curly braces

in L-Systm rules?

In my L-System, I have a trunk of a tree and I want to grow two

branches out of it. Both starting at the same point on the trunk.

If I do it with square braces, the branches are not connected to the trunk,

and I want them to smoothly interpolate with it.

In The Name Of All That is Holy! How is it done?

I've spent almos all night trying to solve this one and I want to sleep.

Mommy :(:mellow::D

Share this post


Link to post
Share on other sites

Curly braces are used to create single polygons inside the l-system (e.g. to create leaves on a tree without any input geometry). A '{' starts and '}' ends a polygon. The character '.' adds a vertex. This is essential, if you work with curly braces, otherwise they won't have any effect. But they can't be used to create branches. Therefore the square brackets exist.

Here is an example:

Premise:  A
Rule 1:     A=F[+(90)/(90)B]A
Rule 2:     B={C.}
Rule 3:     C=.F+C

The rule 1 creates a straight line, that has a branch on every step. This branch is created using square brackets. The shape of the branch is specified by B. The Rule for B Tells the l-system to create a polygon (the curly braces) and the vertex positions are specified by the rule for C. 'C' now simply creates a new vertex ('.') and then moves forward, turns to the right and repeats. After all the repetitions of C rule B is setting a last vertex on the polygon and ends it.

Normally branches created with square brackets should be connected to the trunk automatically. Perhaps you have a lower case 'f' instead of a upper case 'F' inside the rules. This lower case character moves the cursor/turtle forward without creating geometry to create non-connecting geometry.

Share this post


Link to post
Share on other sites

Ooops.

Forgot the image.

And I want the branches actually grow out of the trunk rather than

stick out like that, right out of the body of the trunk.

post-15-1087655106.jpg

Share this post


Link to post
Share on other sites

Polywire SOP should give you geometry that has brunches smoothly connected to the trunk.

Share this post


Link to post
Share on other sites

Yep, use polywire. I rarely let the lsystem sop generate tubes. If you have different curves with unshared points, just run them through fuse SOP then through the polywire SOP.

In the preferences for the polywire, there is an entry for l-system. Choose that and the polywire now nicely behaves with the lsystem generated curves. The preferences button is revealed by opening up the stowbar running horizontally near the top of each operator.

-jeff

Share this post


Link to post
Share on other sites

there is a brute approach using metaballs copied on lsys-spline points

those metaballs could be scaled by using a color ramp over generations

or branches. Have done a job on modelling corals with this technique:

if you someone is intrested i could share more of this

post-15-1088629482.jpg

  • Like 1

Share this post


Link to post
Share on other sites

hi, this looks very nice :D

Share this post


Link to post
Share on other sites

thx for all replies :)

try a short description of my coral technique:

the way corals look is quite similar to merged metaballs...

so i found two solutions using Lsystem skeletons with metas

first is copy sop and a applied color point attribute for scaling tips;

second using metas as leaf input directly in the lsystem which is

gives much more control but is hard to work with.

Then i used convertmeta and polyreduce sop to get a final not to heavy geometry.

post-15-1088798747.jpg

Share this post


Link to post
Share on other sites

hi skello,

this is a ramp created with the external prog called ramp editor( redit.exe). This gradient is used to grade the lsys- splines- tips to get them smaller

( used a primitive sop on those colors)

:)

Share this post


Link to post
Share on other sites

redit working fine here.. winxp, 6.1.208..

on another note..

fex: why did you choose an image ramp as your method? im not saying it's wrong because your results are obviously great, but i was just curious for my own knowledge why you went that route as opposed to using copy stamping or the point() function to scale the metaballs based off the "gen" or "width" attribs.

did you happen to try any other methods and found the image ramp was a better\faster solution? im just interested to see if you investigated in to other things and could comment on them to enlighten us (well me atleast :D)

thanks,

dave

EDIT:

also.. how can i use an image file (such as a tga) as to appy color to my l-system.. i went ahead quickly made a 500x500 image of a black to white gradient going up and down and couldn't get it to show anything on my l-system. anybody know how to do this? am i just completely thinking about this the wrong way?

Share this post


Link to post
Share on other sites

Hmm... it must be my graphics driver, then... I am still on 44.9 or something of the sort. Trouble is that I am working on my VAIO laptop and had to use Sony supplied nvidia driver. I probably need to replace a particular .ini file with Sony supplied file, I believe, to get the latest nvidia driver to install. Just haven't had time to deal with that yet... :P

Share this post


Link to post
Share on other sites
Hmm... it must be my graphics driver, then... I am still on 44.9 or something of the sort. Trouble is that I am working on my VAIO laptop and had to use Sony supplied nvidia driver. I probably need to replace a particular .ini file with Sony supplied file, I believe, to get the latest nvidia driver to install. Just haven't had time to deal with that yet... :P

Hey Alex, this page might help http://www.laptopvideo2go.com/

Achim

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×