cgp Posted July 25, 2018 Share Posted July 25, 2018 Hi! How do I make the global (scene Y) gravity direction for copied l-systems? Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted July 28, 2018 Share Posted July 28, 2018 If you want to do this with L-systems specifically, you have to write a set of rules that would allow you to input: an initial growth direction (derived from the normal on the target surface)... L-systems can read its own variables b,c,d , you can rotate the initial segment to give the initial growth direction. But then you have to figure out a set of rules to will implicitly growth the trunk towards global Y+, so that it eventually becomes vertical, but not too soon so that it doesn't hit your sphere. You also also tropism with T(g) which will allow you to grow the secondary branches towards global Y-. You can also hard code the premise in a for loop (parameter premise car reference a string you build in a for loop) It seems doable, but I've seem this recently: It would be a lot easier to compute the location of a few points from one point in space (initial growth point), one normal, and a bounding sphere in which you can't enter. 1 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted July 28, 2018 Share Posted July 28, 2018 The way I've done this in the past is by not orienting the L-system copies with template point attributes (remove N/up/orient entirely), and instead orienting the turtle for each copy using stamp() functions. The $(x,y,z) L-system command can orient the turtle to grow in whatever direction, while maintaining world Y-up for the tropism (T) function. I wrote a blog post a few years ago with an example .HIP included. It's way out of date but L-systems haven't changed much. Check it out: http://www.toadstorm.com/blog/?p=230 1 Quote Link to comment Share on other sites More sharing options...
cgp Posted July 29, 2018 Author Share Posted July 29, 2018 Thanks Henry, this is very useful. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.