Growing LSystems towards targets

   6982   5   1
User Avatar
Member
862 posts
Joined: Oct. 2008
Offline
I'd like to grow LSytems towards targets. Is there a standard way to do this or do I need to come up with a custom solution?

My idea is to build a VOPSOP network that creates 2 custom attributes to vary the angle and length of the LSystem elements according to the tree-branch position relative to the target(s).

One problem I can see with this is that it may not be possible to access those points on an LSystem where growth occurs (the postition always refers to the whole Lsystem's object?)

Any ideas on other approaches? Dynamic rigs?
--
Jobless
User Avatar
Member
862 posts
Joined: Oct. 2008
Offline
I had a more detailed look at the LSystems. I think the $(,x,y,z) turtle command does what I want.

In the LSystem Rules tab I have entered $(b,c,d) in “Rule 1”. The b,c,d variables are in the Values tab.

Question: How do I make those b,c,d variables the same as those of the box position in the scene (modified via the VOPSOP)?

I want the LSystem to grow towards the box, wherever I place it.

Attachments:
LSystuntitled.hipnc (53.4 KB)

--
Jobless
User Avatar
Staff
3456 posts
Joined: July 2005
Offline
have a look at the origin expression…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
862 posts
Joined: Oct. 2008
Offline
Thanks Arctor, I'll have a look at that too.

But first I need to know how to reference stuff in expressions.

Sorry, I can't express myself very well. I'll need to get used of the Houdini lingo… I attached an image.

Attachments:
Variables.jpg (102.7 KB)

--
Jobless
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
If you want the centroid of the geometry in the VOP SOP:
centroid(“../vopsop1”, D_X)
centroid(“../vopsop1”, D_Y)
centroid(“../vopsop1”, D_Z)

If you want a specific point in the geometry to be the target:
point(“../vopsop1”, 0, “P”, 0)
point(“../vopsop1”, 0, “P”, 1)
point(“../vopsop1”, 0, “P”, 2)
where “../vopsop1” is the path reference to your target SOP
0 is the specific point number in the target geometry you wish to querry
“P” is the Position data attribute to reference
The last value is the index in to the attribute. Since P position is a three float vector, 0 is x, 1 is y and 2 is z.


Since this is all inside the same object, you don't have to concern yourself with incorporating object transforms in to the expression. If so please do what Arctor recommends and look at the origin() function to add to the above expressions.

Please see the Houdini help. Writing expressions in Houdini is not difficult at all. Just get in there and get your hands dirty. See the expression cookbook in the help. As well open the textport (alt-shift-t) and type in:
exhelp
to see all the expression functions.
Type:
exhelp point
to see the usage for the point expression.
Type:
exhelp centroid
to see the usage for the centroid expression.

Type:
exhelp -k center
to search (-k is option to pass in a key word) on a key word. In this case find all functions that have “center” in their help.
There's at least one school like the old school!
User Avatar
Member
862 posts
Joined: Oct. 2008
Offline
Thanks Jeff. Very useful help. I'll dive into that. At the moment I can make it grow towards the target. At each increase in generations though it changes its initial shape. It think the whole system gets recalculated completely at each step, rather than appended to the old bit.
--
Jobless
  • Quick Links