【源码】leafpile3D:三维落叶飘零模拟

【源码】leafpile3D:三维落叶飘零模拟_第1张图片

这是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:三维落叶飘零模拟_第2张图片

你可能感兴趣的:(【源码】leafpile3D:三维落叶飘零模拟)