达达首页 | 设计教程 | 辅助工具 | 字体字库 | 素材贴图 | 非 主 流 | PS 笔刷 | 签名模版 | 网页模版 | 达达贴吧
设为首页

加入收藏

联系我们
PhotoShop 教程 | Illustrator 教程 | CorelDraw 教程 | FireWorks 教程 | 3D MAX 教程 | MAYA 教程 | Flash 教程 | After Effects 教程
相关教程
普通教程 MAYA 制作烟火教程
普通教程 使用PF粒子制作“雨…
普通教程 MAYA用粒子给文字勾…
普通教程 MAYA教程:用粒子制…
普通教程 了解maya粒子—动力…
普通教程 利用MAYA制作下雪的…
普通教程 在Maya中使用粒子产…
普通教程 MAYA粒子教程:落花…
普通教程 MAYA粒子教程:制作…
普通教程 金沙MAYA——粒子动…
最新更新

Maya粒子特效动画…

Maya教程:柔体制…

MAYA教程:制作剔…

改变Sprites型粒子…
您现在的位置: 达达派 >> 教程中心 >> MAYA教程 >> 粒子篇 >> 教程正文
利用 randomly rotation 创造落叶(英文)
作者:佚名 文章来源:网络采集 点击数: 更新时间:2006-5-25 21:05:35
教程录入:carcass    责任编辑:carcass  添加到雅虎收藏+

We will create some falling leaves with randomly rotation driven through expressions (don´t worry - some easy expressions!).


Create a simple nurbs-plane with patching of 3 in u and v.

Select the plane and turn it into an emitter (F4 -> particles -> Emit from object -> optionbox). To prepare the particles for moving downwards (-y), simply set the "Normal Speed" to something like -2. Set the rate to 10-20 and hit create. Play the animation some frames that you can see the particles. Now select the particles and add a gravity field with the settings magnitude=5 and attenuation=0. Now add a turbulence field with the settings magnitude=10 and attenuation=0. Depending on your scale you have to vary with these settings. The goal is that the particles should tumble around and fall slowly. You also have to experiment with the "conserve"-value of the particles. I found a 0.92 to be ok.



For this test, create a simple poly-leaf and let it instance the particles (to do that, just select the geometry (you don´t need to select the particles) and open the optionbox from the "Instancer"-command within the Particles-menu - the default-settings should be fine, just make sure that under "Particle Object to Instance" the right particles are selected - and finally hit create). Now the particles are replaced with the geometry.


Open up the attribute editor of the particle-shape and under the "Per Particle (Array) Attributes" add a "General"-dynamic attribute. Name it something like "rotPP", Data Type has to be "Vector", Attribute Type has to be "Per Particle (Array)". Hit ok.


In the "Per Particle (Array) Attributes" - folder you should now see the new attribute. Rightlick on it and add the following "Creation-expression":

particleShape1.rotPP = rand (0,360);

This just gives each particle a unique rotPP-value of 0 - 360.

Next, you need to create a runtime-expression to control this value over time. To do that - you don´t have to close the expression-editor - simply click on "runtime" in the expression-editor and add the following expression:

particleShape1.rotPP += 0.001;

The "+=" tells Maya to add a value of 0.001 each frame to the inital value given by the creation-expression.


Now we have to tell Maya to use that value "rotPP" for controlling the rotation of the particles. To do that go to the "instancer"-folder in the particle-shape node and in the Rotation-options set the Rotation to "rotPP" (the rotation-type you can leave at "none").

For testing the animation hit play. The leaves should tumble around and rotate randomly.


To control/stop the rotation when hitting a ground we have to edit the expression a little bit. First, create a second plane. Scale the plane up and place it a bit lower that it can serve as our ground. With that plane still selected, shift-select the particles and turn on "Make collide" (particles-menu) with the setting friction=0.8-1, depending on how fast you want to stop the leaves when hitting the
ground.



If you hit play, you can see that the particles stop at the ground but keep on rotating, which is not what we want. To edit that we have to take the velocity of the particle into account. Again, open the Attribute-Editor of the particle-shape node and edit the runtime-expression by right-clicking on the "rotPP"-field in the "Per particle (Array) Attributes". We´ll create a new variable that reads the velocity of each particle and divides that value by 2000:

float $vel = (particleShape1.velocity)/2000;

Now, instead of just adding a value of 0.001 to the rotPP-variable each frame, we´ll add the $vel-variable:

particleShape1.rotPP += $vel;

That´s it. When the particles hit the ground they should stop rotating (since velocity=0 -> $vel=0 and nothing is added to the rotPP value). Another good thing about the velocity is, because of the turbulence field and the conserve-setting there are moments where the leaves almost "stand still in the air", thus have only little velocity at that time and ... you guessed right, don´t rotate much - like in reality. On the other side, the faster they fall, the faster they rotate.
  • 上一篇教程: 没有了

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    关于我们 | 帮助(?) | 广告服务 | 版权声明 | 商业合作 | 发展历程 | 联系我们

    Copyright ? 2005-2008 CGFancy.com, All Rights Reserved,达达网络:陕ICP备06010337号

    技术交流:71125455(平面)、545534707(三维),业务合作:71125455