SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Lighting & Rendering, Dynamics & Effects, Texturing / Dynamics & Special Effects / Particle Simulation (Very Technical, Need Help!)
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 29-09-2007, 03:22 PM   #1
Kartzan
Subscriber
 
Join Date: Oct 2005
Location: US of A
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default Particle Simulation (Very Technical, Need Help!)

Hey all,
I'm working on a project, a sort of partical simulation. Basically the goal is to have a surface emit particles that float downward toward a sphere that attracts all nearby particles within a certain radius.

That was the easy part, and its all finished.

The task at hand is to be able to change the attributes of the particles once they've entered a certain radius around the sphere. For example, a particle enters the gravitational field of the sphere, and as it does so, it change color from blue to red and begins to emit a soft glow, growing stronger as it nears the sphere.

I've been doing some research and it looks like I'm going to have to do some MEL scripting to set it up correctly, and unfortunately I dont know a damn thing about MEL aside from what i've read today. I'm planning on learning MEL because I'm going to obviously need it to complete my goals, but any help, tips, pointers, or anything that could help would be much appreciated.

Thanks everyone!!!
__________________
Death is certain, Life is not.
Kartzan is offline   Reply With Quote
Old 30-09-2007, 07:00 AM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I at work now so I don't have time to finish this. Anyway here's one way for that particle going from blue to red within a specified radius of an object (pSphere1 in this case). Just add rgpPP and a cusom scalar attribute called effectRadius (set it bigger than the radius of your sphere to see the effect better) to your particle shape and enter the following into your runtime after dynamics expression:

Code:
vector $vWPos = worldPosition;
vector $vSPos = <<pSphere1.translateX, pSphere1.translateY, pSphere1.translateZ>>;
float $fDistance = mag($vWPos - $vSPos);

float $fEffect = 0;
if($fDistance < effectRadius);
	$fEffect = 1 - linstep(0, effectRadius, $fDistance);

rgbPP = <<$fEffect, 0, 1 - $fEffect>>;
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 30-09-2007, 02:18 PM   #3
Kartzan
Subscriber
 
Join Date: Oct 2005
Location: US of A
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot for the help! I'll give it a try tommorow and see how it work.
__________________
Death is certain, Life is not.
Kartzan is offline   Reply With Quote
Old 18-10-2007, 07:07 PM   #4
Kartzan
Subscriber
 
Join Date: Oct 2005
Location: US of A
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot for the help!

However, I've been playing around with the expressions and I'm trying to get the particles to die now once they are inside the target sphere, and well, its not working the way I would like.

When I try it one way, the particles die before moving, and then the other way nothing happens. Its almost as if the particles have a world position of 0,0,0 when they are born.

Any thoughts?

Thanks again all!
__________________
Death is certain, Life is not.
Kartzan is offline   Reply With Quote
Old 18-10-2007, 07:21 PM   #5
Kartzan
Subscriber
 
Join Date: Oct 2005
Location: US of A
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

Never mind, got it to work
__________________
Death is certain, Life is not.
Kartzan is offline   Reply With Quote
Old 20-10-2007, 03:15 PM   #6
Kartzan
Subscriber
 
Join Date: Oct 2005
Location: US of A
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, now for something a little more complicated...

To recap, there is a plane emitting particles downward toward the origin, where a sphere rests. This sphere attracts all nearby particles, and the particles that get close change color from blue to red.

My next goal is to make it so the surface of the sphere changes color as a particle nears it. I dont mean the entire sphere, I just mean a small localized region that is near the particle.

For example, I have a green sphere, and as a particle approaches it, I want the point on the surface of the sphere to glow orange gradually as the particle moves closer to the surface of the sphere.

Thanks all!
__________________
Death is certain, Life is not.
Kartzan is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.