CGTalk > Software > Autodesk Maya > Maya Dynamics
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 08-26-2003, 09:18 AM   #1
nofriends_1985
New Member
Student
 
Join Date: Apr 2003
Posts: 13
Ripple Effect

Hello,
I was wondering how i could get particles to collide with a surface and make a ripple effect?
 
Old 08-27-2003, 05:45 PM   #2
minos365
Veteran
portfolio
minos yu
shanghai, China
 
Join Date: Jan 2003
Posts: 70
Send a message via MSN to minos365
i ask this question before,
he tell me use collisionU and collisionV to know where particle hit surface,
and then use fluid effect to do the effect
i know this first
but i dont know this second
 
Old 08-28-2003, 03:04 AM   #3
nofriends_1985
New Member
Student
 
Join Date: Apr 2003
Posts: 13
mmm...

yer i know what you mean i know how to do the first part but i dont know how you can get the ripple with fluid effects... i was thinkin of somekind of soft body simulation
 
Old 08-28-2003, 03:45 PM   #4
minos365
Veteran
portfolio
minos yu
shanghai, China
 
Join Date: Jan 2003
Posts: 70
Send a message via MSN to minos365
if i use softbody,it need a lot of point,
it too slow
 
Old 08-28-2003, 04:25 PM   #5
Duncan
Expert
 
Duncan's Avatar
Duncan Brinsmead
Principal Scientist
Autodesk
Canada
 
Join Date: Jun 2002
Posts: 2,995
Once you have the uv point on your surface you can emit into that uv position on a fluidTexture2d(applied presumably as a displacement map). To get a ripple simulation set the fluid solver to "spring mesh".

In your particle runtime expression you can determine the grid index at the collision point by dividing the uv by the grid resolution uv.

// assuming you have defined the variables collideU +V
// if the particle collides do the following:
int $dropSize = .5; // depth of ripple to create
int $indexU = $collideU/(float)fluidTexture2DShape1.resolutionH;
int $indexV = $collideV/(float)fluidTexture2DShape1.resolutionW;
setFluidAttr -xi $indexU -yi $indexV -at density -ad -fv $dropSize fluidTexture2DShape1;

The above adds in a density to the fluid texture at the particle collide location which will generate a ripple at that point. I'm assuming that your code already initializes a colldeU and V variable and that you have created a texture called fluidTexture2DShape1 that is assigned to the same surface being collided with.

Duncan
 
Old 08-29-2003, 06:46 AM   #6
minos365
Veteran
portfolio
minos yu
shanghai, China
 
Join Date: Jan 2003
Posts: 70
Send a message via MSN to minos365
hi Duncan
i try,but it dont work,i dont know what is wrong.
i attach maya file,can you tell me what is wrong.
thanks
 
Old 08-30-2003, 08:41 AM   #7
nofriends_1985
New Member
Student
 
Join Date: Apr 2003
Posts: 13
Thanx Duncan...

hey minos365

it took me a few hours but i got it to work with the following code :

float $colU = particleShape1.collisionU;
float $colV = particleShape1.collisionV;
int $dropSize;
int $indexU;
int $indexV;


if ($colU > 0)
$dropSize = 1; // depth of ripple to create
$indexU = (float)fluidTexture2DShape1.resolutionH*$colU;
$indexV = (float)fluidTexture2DShape1.resolutionW*$colV;
setFluidAttr -xi $indexV -yi $indexU -at density -ad -fv $dropSize fluidTexture2DShape1;


there is probally a lot better way of writting this code but i am new to mel and this was the best i could do. One thing that you have to make sure of is that the UV of your nurbs mesh lines up with the XY or hight width of your fluid texture. I had a look at your scene file and you should lie your fluid texture on top of your nurbs mesh easier to see whats happening
Attached Images
File Type: jpg ripple.jpg (9.7 KB, 128 views)
 
Old 08-31-2003, 03:03 PM   #8
minos365
Veteran
portfolio
minos yu
shanghai, China
 
Join Date: Jan 2003
Posts: 70
Send a message via MSN to minos365
thanks
i will try
 
Old 09-01-2003, 11:48 PM   #9
stallion151
constipated CG
 
stallion151's Avatar
M
Australia
 
Join Date: Apr 2003
Posts: 1,552
i think u should change those int values to float values.
 
Old 09-03-2003, 05:49 PM   #10
Duncan
Expert
 
Duncan's Avatar
Duncan Brinsmead
Principal Scientist
Autodesk
Canada
 
Join Date: Jun 2002
Posts: 2,995
Oops! Yes I meant float for dropSize (the indices are ints, however).


Duncan
 
Old 09-04-2003, 02:09 PM   #11
nofriends_1985
New Member
Student
 
Join Date: Apr 2003
Posts: 13
Duncan

Duncan...

thanx for all your help you sure know your stuff!!!! i couldnt think of anyway of doing it. but your fluid Effects is great and not to system hungry i was wonder if you mind if i write a tutorial on how to make ripples?
 
Old 09-04-2003, 04:34 PM   #12
Duncan
Expert
 
Duncan's Avatar
Duncan Brinsmead
Principal Scientist
Autodesk
Canada
 
Join Date: Jun 2002
Posts: 2,995
How could I possibly mind you writing a tutorial? We need more fluids tutorials!
Duncan
 
Old 01-16-2006, 12:00 AM   #13
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:06 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.