【源码】leafpile3D:三维落叶飘零模拟
這是leafpile.m的三維擴展,包括添加物理的能力(目前是我的微分方程學生的HW作業)。
This is a 3D extension of leafpile.m and includes to ability to add physics (currently the HW assignment for my Differential Equations students).
同樣的,這個代碼只是讓重力單獨作用在樹葉上。
As is, the code just lets gravity act alone on the leaves.
該代碼利用了Hamid Naderi Yeganeh描述橡樹和楓葉形狀的奇妙參數曲線[1]和MATLAB內置的秋季色彩圖。
This code takes advantage of Hamid Naderi Yeganeh’s wonderful parametric curves that describe oak and maple leaf shapes [1] and MATLAB’s built-in Autumn colormap.
在使用了一些隨機選擇的顏色映射、葉坐標、橫滾、俯仰、偏航,我們自己有了一個不錯的小葉子堆生成器!
After using some randomization on the colors chosen within the colormap, the leaf coordinates, roll, pitch, and yaw, we have ourrselves a nice little leaf pile generator!
當你可以在舒適的MATLAB控制臺中體驗一年四季的美好時光,為什么一定要等到10月中旬呢?
Why wait until Mid October when you can experience those beautiful few weeks all year round within the comfort of your MATLAB console?
這段代碼將在我的學生HW作業完成后用一些現實的阻力定律進行更新。
This code will be updated with some realistic drag laws after my students’ HW assignment is due.
最終加入一些滑塊控件,就像肖恩·德沃斯基(Sean de Wolski)去年為2D葉堆代碼所設計的那樣。
I’d also like to eventually incorporate some slider controls like Sean de Wolski did for the 2D leafpile code last year.
[1] Hamid Naderi Yeganeh, Scientific American, March 16 2017, https://blogs.scientificamerican.com/guest-blog/how-to-draw-with-math/
更多精彩文章請關注公眾號:
總結
以上是生活随笔為你收集整理的【源码】leafpile3D:三维落叶飘零模拟的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 烩茄子
- 下一篇: 神州数码防火墙与路由器之间配置IPSec