ShenchengFu-Deliverables3B
Diffusion-Limited Aggregation: https://openprocessing.org/sketch/2032962
The particle system in the code simulates the growth process of crystals. The particles will randomly move and adhere together, gradually forming a pattern with a crystal like structure. Each particle will randomly choose one of the four directions up, down, left, right, and move by one step. The color of the particles will change according to their position. Through the HSB color mode, the color of the particles will gradually change from 0 ° to 315 °, presenting a rich color range. Users can select the crystal arrangement (center or border) through the selection box on the interface, and regenerate the crystal through the reset button. Once the particle adheres to the crystal, it becomes a part of the crystal and is removed from the particle list.
L-Systems: https://openprocessing.org/sketch/2032966
The code starts by defining an initial axiom as a single character “F” and creating a sentence to store the current state. The initial statement is the same as the axiom, and the rules of the L-System are defined in the rules array. In this example, there is only one rule where the character “F” is replaced with “FF+[+F-F-F] – [- F+F+F]”. This rule specifies the way branches grow. The generate function is responsible for generating sentences for the next generation of branches and leaves based on rules. It checks the characters in the current sentence one by one, replaces them according to rules, and reduces the branch length to simulate the growth process. The turn function is responsible for interpreting sentences and drawing the shape of the tree. It uses operations such as movement and rotation to draw the shape of tree branches, as well as saving and restoring the current drawing state by pushing and popping matrices.
The artistic effect of this code is mainly reflected in simulating the growth process of trees. Through the iterative application of L-System rules, the branches of trees continue to grow and branch, creating the appearance of natural trees. By reducing the length of branches and adjusting the angle, the process of branch growth looks more realistic, as if simulating the growth of real trees. Through the “Generate” button, users can manually trigger the growth process of trees, observe the changes of each generation, and increase interactivity and entertainment.
Random Walk&Brownian Motion: https://openprocessing.org/sketch/2032969
In this Random Walk or Brownian Motion system, a small 2D element moves erratically from one moment to the next, leaving a trail across the canvas as it travels. At each time step, the element’s current position is updated with a small random displacement in both the X and Y directions. The primary technical goal here is to simulate the unpredictable and erratic movement of particles in a random walk.
it aims to create an interesting visual effect by capturing the element’s path as it moves, leaving behind a trail of its motion, The flickering and changing colors further enhance the dynamic visual effect of the entire system over time, enhancing the visual appeal of the random walk. By combining the technical and aesthetic aspects, strives to produce a visually intriguing representation of the Brownian motion phenomenon.