Link:INB Home|INB English| INB русский язык|INB العربية|INB Türkiye|INB فارسی|INB Español|INB Français|INB Português|INB Deutsch|INB 國語|INB 中文|INB 日本语|INB 한국어|INB ภาษาไทย|INB tiếng Việt||Maya Tutorial Making a Blizzard 2/4
INB English forum
Welcome to (Industry & Native boffin) The industrial age here is full of fighting spirit, you and I both through this network space with Native biological spirit boffin came to the mad labs. home INBforum.com, come and join us Permanent name: inb-english.forumotion.com
INB English forum

Welcome to (Industry & Native boffin) The industrial age here is full of fighting spirit, you and I both through this network space with Native biological spirit boffin came to the mad labs. home INBforum.com, Permanent name: inb-english.forumotion.com


You are not connected. Please login or register

《《《《《《《上一页INBforum   Go down

上一页INBforum》》》》》》》View previous topic View next topic Go down  Message [Page 1 of 1]

1 Maya Tutorial Making a Blizzard 2/4 on Fri Sep 24, 2010 2:05 am

Admin

avatar
Admin


Go to per particle (array) attributes tab. Click Add button . In particle tab choose collisionTime. This attribute stores time when particle collided.

[You must be registered and logged in to see this image.]

If you wonder what is the value of collisionTime for each particle, you can do this: 1. Right click on particles, in marking menu choose particle. 2. Select all particles.

[You must be registered and logged in to see this image.]

Go to window/general editors/component editor. In particles tab there’s collision time. It is -1 for each particle. Collision time changes value only in the moment particle collides. We will base our expression around that fact.

[You must be registered and logged in to see this image.]

By the way, the second way to query attribute values is to set mode to Numeric. In attribute name enter the name of attribute you want to see.

[You must be registered and logged in to see this image.]

Also, add particle attribute named Status. It must be per particle (array), because every particle will have its own value for this attribute.

[You must be registered and logged in to see this image.]

Right click on your newly created attribute. In menu choose runtime after dynamics. Enter the expression from the picture. So the first if will query if Status is less than 1. Status is by default 0, so commands inside this if will execute by default unless we change the value of the status attribute. The second if queries if a collision has occurred. When particle collides collisionTime get’s value. If collision occurs it will set Status to 1. So when whole expression is executed next time, first if will not allow any of commands inside to be executed. In other word’s it will skip everything.

[You must be registered and logged in to see this image.]

Status attribute looks like this.

[You must be registered and logged in to see this image.]

Add another attribute named velTMP. This time it must be vector type, since we will deal with velocity which is also a vector.

[You must be registered and logged in to see this image.]

Now go to runtime before dynamics. Enter expression from picture below. So if Status is less than 1 (if particle not collided) than particle will get remain its velocity.

[You must be registered and logged in to see this image.]

Edit after dynamics expression. This will set velocity to the last value before collision. That’s why we split expression in two parts.

[You must be registered and logged in to see this image.]



So, now it works.

[You must be registered and logged in to see this image.]

There’s another way to this. Set AimDirection to velTMP

[You must be registered and logged in to see this image.]
]

View user profile http://eng.inbforum.com

上一页INBforum   Go down

上一页INBforumView previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum

Copyright ©2009-2016 LTD Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

IT:SINGLESERVGoogle谷歌翻译TranslateFORUMSOFTLAYERGoogle谷歌广告联盟AdSenseAsia

 

Make a forum | © PunBB | Free forum support | Contact | Report an abuse | Forumotion.com