【源码】leafpile3D:三维落叶飘零模拟
這是leafpile.m的三維擴(kuò)展,包括添加物理的能力(目前是我的微分方程學(xué)生的HW作業(yè))。
This is a 3D extension of leafpile.m and includes to ability to add physics (currently the HW assignment for my Differential Equations students).
同樣的,這個(gè)代碼只是讓重力單獨(dú)作用在樹葉上。
As is, the code just lets gravity act alone on the leaves.
該代碼利用了Hamid Naderi Yeganeh描述橡樹和楓葉形狀的奇妙參數(shù)曲線[1]和MATLAB內(nèi)置的秋季色彩圖。
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.
在使用了一些隨機(jī)選擇的顏色映射、葉坐標(biāo)、橫滾、俯仰、偏航,我們自己有了一個(gè)不錯(cuò)的小葉子堆生成器!
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!
當(dāng)你可以在舒適的MATLAB控制臺(tái)中體驗(yàn)一年四季的美好時(shí)光,為什么一定要等到10月中旬呢?
Why wait until Mid October when you can experience those beautiful few weeks all year round within the comfort of your MATLAB console?
這段代碼將在我的學(xué)生HW作業(yè)完成后用一些現(xiàn)實(shí)的阻力定律進(jìn)行更新。
This code will be updated with some realistic drag laws after my students’ HW assignment is due.
最終加入一些滑塊控件,就像肖恩·德沃斯基(Sean de Wolski)去年為2D葉堆代碼所設(shè)計(jì)的那樣。
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/
更多精彩文章請(qǐng)關(guān)注公眾號(hào):
總結(jié)
以上是生活随笔為你收集整理的【源码】leafpile3D:三维落叶飘零模拟的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 烩茄子
- 下一篇: 神州数码防火墙与路由器之间配置IPSec