Jump to content

l-system question


michael

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.

Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...