ScratchData LogoScratchData
Back to crkcity's profile

Swaying Seaweed as L-system

CRcrkcity•Created January 27, 2022
Swaying Seaweed as L-system
11
7
33 views
View on Scratch

Instructions

Fractal seaweed automatically moves, as if swayed by the water current. You can adjust step length as it runs to make it grow or shrink. Spacebar changes backgrounds (painted by my wife) The branching is fractal, meaning similar across scales, large and small. Uses a system of commands, know as L-system, turning left, right, and returning to previous positions. It's convenient for building a wide variety fractals. This one here is usually called "L-System Bush." Looks to me like seaweed so I went with that theme.

Description

Simulates the waving movement by having the branching angle increase and decrease. Background painted by my wife Kathy, moves with the angle change (using set whirl effect to angle). Standard L-System rules for a fractal "bush." I made it repeat fast so that you could adjust in real time, and added seaweedy coloration. Look at the code inside and see that the L-System uses the term "F" to indicate move foward by the step length, the term "+" to turn clockwise, "-" counterclockwise by the branch angle, "[" means branch point, and "]" means branch completed. I change the angle by constantly resetting the branching angle to the sine of an angle which whirls around like a second hand on a clock.

Project Details

Project ID635095336
CreatedJanuary 27, 2022
Last ModifiedJanuary 27, 2022
SharedJanuary 27, 2022
Visibilityvisible
CommentsAllowed