Jump to content

l-system question

Recommended Posts

You can use the same variables in different rules. Houdini will set the corresponding values based on the current token. This means, that the variables are local to the rules, not global to the whole l-system. In the premise you only define a starting-value for the variables needed by the token (if you omit them, Houdini sets the default-value, which is normally zero).

I changed your example to demonstrate this:

Premise: [A(1,1)]G(1)[A(2,2)]
Rule 1:    A(i,j)=^(90)B(i,j)
Rule 2:    B(i,j):j>0=F(i,j)B(i/2,j/2)

The "G", "^" and square brackets in the premise and rule 1 are only to separate the 2 objects. But you notice, that A is instantiated 2 times, each with different values. Houdini now sets the values of i and j to 1, when it derives the first occurance of A and the variables are set to 2, when replacing the second occurance of A.

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