Last year I picked leaf pile which generated pretty leaves in 2d. Well now there are 3d options! Nathaniel has extended the 2d version to show the leaves falling with gravity.
However, it appears he wrote this so that his students could extend it and add physics to it. I don't know of Chris is one of his students or not, but he extended it and added variable drag based on leaf type, and rotation. I find I'm just sitting here waiting for that last leaf to hit the ground.
leafpile3Dd(30) % added d at end to disambiguate
I also like some of the code changes that Chris made. Specifically, keeping one command per line and splitting some of the longer lines into multiple for readability or better interpretability with source control.
You can see a comparison of the two files in MATLAB by selecting them and comparing to each other or by calling visdiff.
Published with MATLAB® R2020b
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.