Lindenmayer icon indicating copy to clipboard operation
Lindenmayer copied to clipboard

enable tropism - vector effects for turns, bends, and rolls

Open heckj opened this issue 4 years ago • 1 comments

It would be nice to add the ability to easily compute adjustments to final vectors resulting from the 3D modeling commands of yaw, pitch, and roll so that effects such as Tropism (either from wind or sun) could be included in calculating the resulting growth direction of L-systems.

I'm not sure how easily that could be accommodated, and where would be most appropriate - but I'm guessing as an additional component to the production results when there's an explicit growth or bend.

heckj avatar Dec 23 '21 21:12 heckj

I stashed two RenderCommands specifically to support Tropism:

  • TurtleCodes.spinVerticalTropism
  • TurtleCodes.spinGravityTropism

The idea being that the RenderCommand includes a parameter that indicates how much (% maybe?) Tropism should take effect at this bend. It basically bends the directional heading even further upward (to the 'sun') or downward (representing 'gravity').

The ABOP book (pg 58) has some references to experiments supporting arbitrary directional tropism to represent wind as well, which appear to be a common parameter to the system, so that one L-system only supports tropism in a single direction.

It should be quite possible to provide an arbitrary tropism unit vector as a parameter to one of these codes for the renderer.

heckj avatar Jan 24 '22 06:01 heckj