Stanford Interactive Graphics HW1
Broccoli is generated using L-system. Broccolis are independently generated in parallel using POSIX Thread.
Also the plane, ball, trees are saved in Vertex Array Object according to OpenGL3.3 syntax.
Balls are drawn using the same vertex buffer object. Balls are scaled by their index. i.e. first ball is of size 1, 100th is of size 100.
L-system function is recursively called (plus random perturbation for natural looking branching angles) to generate whole tree.
X window created using GLFW3.
Screen captured using ffmpeg + libpng
Reference
L-system : en.wikipedia.or...
GLFW3 : www.glfw.org/do...
pthread : computing.llnl...
Code implemented in C++/OpenGL 4.1/GLFW3
Source code : chrischoy@bitbucket.org/chrischoy/broccolis_and_balls.git
11 сен 2024