View Full Version : Ocean Crashing Wakes

 Bernard39705 May 2008, 07:22 PMHello, I've created an Ocean with an object (pilar) in it. I also created a wake in the ocean. Now I want to generate particles where the wake strucks the pilar. (particles are only generated when the wakes upward velocity exceeds a certain threshold value) I also want the particles to enherit the velocity of the wake velocity.... Thanks, bern
Aikiman
05 May 2008, 09:05 PM
The only method Im aware of is from Duncans DVD of fluids where he uses a nurbs plane, which is dynamically mapped to the oceans displacement, and uses the intersect surfaces to create a curve on the pillar. The curve is then used as the emitter and takes the Oceans displacement in Y as position and velocity vectors that determine particle lifespan and velocity. Unfortunately you would need the mel script to map the nurbs plane to the ocean displacement which I dont have but you could always try and google it, or try Highend3D.

float \$u, \$v;
float \$minx = nurbsPlane1.scaleX * -0.5 + nurbsPlane1.translateX;
float \$maxx = nurbsPlane1.scaleX * 0.5 + nurbsPlane1.translateX;
float \$minz = nurbsPlane1.scaleZ * -0.5 + nurbsPlane1.translateZ;
float \$maxz = nurbsPlane1.scaleZ * 0.5 + nurbsPlane1.translateZ;
float \$disp[] = `colorAtPoint -o A -su 6 -sv 21 -mu \$minx -mv \$minz -xu \$maxx -xv \$maxz oceanShader1`;
nurbsPlaneShape1.controlPoints[20].yValue = \$disp[0];
nurbsPlaneShape1.controlPoints[19].yValue = \$disp[1];
nurbsPlaneShape1.controlPoints[18].yValue = \$disp[2];
nurbsPlaneShape1.controlPoints[17].yValue = \$disp[3];
nurbsPlaneShape1.controlPoints[16].yValue = \$disp[4];
nurbsPlaneShape1.controlPoints[15].yValue = \$disp[5];
nurbsPlaneShape1.controlPoints[14].yValue = \$disp[6];
nurbsPlaneShape1.controlPoints[13].yValue = \$disp[7];
nurbsPlaneShape1.controlPoints[12].yValue = \$disp[8];
nurbsPlaneShape1.controlPoints[11].yValue = \$disp[9];
nurbsPlaneShape1.controlPoints[10].yValue = \$disp[10];
nurbsPlaneShape1.controlPoints[9].yValue = \$disp[11];
nurbsPlaneShape1.controlPoints[8].yValue = \$disp[12];
nurbsPlaneShape1.controlPoints[7].yValue = \$disp[13];
nurbsPlaneShape1.controlPoints[6].yValue = \$disp[14];
nurbsPlaneShape1.controlPoints[5].yValue = \$disp[15];
nurbsPlaneShape1.controlPoints[4].yValue = \$disp[16];
nurbsPlaneShape1.controlPoints[3].yValue = \$disp[17];
nurbsPlaneShape1.controlPoints[2].yValue = \$disp[18];
nurbsPlaneShape1.controlPoints[1].yValue = \$disp[19];
nurbsPlaneShape1.controlPoints[0].yValue = \$disp[20];
nurbsPlaneShape1.controlPoints[41].yValue = \$disp[21];
nurbsPlaneShape1.controlPoints[40].yValue = \$disp[22];
nurbsPlaneShape1.controlPoints[39].yValue = \$disp[23];
nurbsPlaneShape1.controlPoints[38].yValue = \$disp[24];
nurbsPlaneShape1.controlPoints[37].yValue = \$disp[25];
nurbsPlaneShape1.controlPoints[36].yValue = \$disp[26];
nurbsPlaneShape1.controlPoints[35].yValue = \$disp[27];
nurbsPlaneShape1.controlPoints[34].yValue = \$disp[28];
nurbsPlaneShape1.controlPoints[33].yValue = \$disp[29];
nurbsPlaneShape1.controlPoints[32].yValue = \$disp[30];
nurbsPlaneShape1.controlPoints[31].yValue = \$disp[31];
nurbsPlaneShape1.controlPoints[30].yValue = \$disp[32];
nurbsPlaneShape1.controlPoints[29].yValue = \$disp[33];
nurbsPlaneShape1.controlPoints[28].yValue = \$disp[34];
nurbsPlaneShape1.controlPoints[27].yValue = \$disp[35];
nurbsPlaneShape1.controlPoints[26].yValue = \$disp[36];
nurbsPlaneShape1.controlPoints[25].yValue = \$disp[37];
nurbsPlaneShape1.controlPoints[24].yValue = \$disp[38];
nurbsPlaneShape1.controlPoints[23].yValue = \$disp[39];
nurbsPlaneShape1.controlPoints[22].yValue = \$disp[40];
nurbsPlaneShape1.controlPoints[21].yValue = \$disp[41];
nurbsPlaneShape1.controlPoints[62].yValue = \$disp[42];
nurbsPlaneShape1.controlPoints[61].yValue = \$disp[43];
nurbsPlaneShape1.controlPoints[60].yValue = \$disp[44];
nurbsPlaneShape1.controlPoints[59].yValue = \$disp[45];
nurbsPlaneShape1.controlPoints[58].yValue = \$disp[46];
nurbsPlaneShape1.controlPoints[57].yValue = \$disp[47];
nurbsPlaneShape1.controlPoints[56].yValue = \$disp[48];
nurbsPlaneShape1.controlPoints[55].yValue = \$disp[49];
nurbsPlaneShape1.controlPoints[54].yValue = \$disp[50];
nurbsPlaneShape1.controlPoints[53].yValue = \$disp[51];
nurbsPlaneShape1.controlPoints[52].yValue = \$disp[52];
nurbsPlaneShape1.controlPoints[51].yValue = \$disp[53];
nurbsPlaneShape1.controlPoints[50].yValue = \$disp[54];
nurbsPlaneShape1.controlPoints[49].yValue = \$disp[55];
nurbsPlaneShape1.controlPoints[48].yValue = \$disp[56];
nurbsPlaneShape1.controlPoints[47].yValue = \$disp[57];
nurbsPlaneShape1.controlPoints[46].yValue = \$disp[58];
nurbsPlaneShape1.controlPoints[45].yValue = \$disp[59];
nurbsPlaneShape1.controlPoints[44].yValue = \$disp[60];
nurbsPlaneShape1.controlPoints[43].yValue = \$disp[61];
nurbsPlaneShape1.controlPoints[42].yValue = \$disp[62];
nurbsPlaneShape1.controlPoints[83].yValue = \$disp[63];
nurbsPlaneShape1.controlPoints[82].yValue = \$disp[64];
nurbsPlaneShape1.controlPoints[81].yValue = \$disp[65];
nurbsPlaneShape1.controlPoints[80].yValue = \$disp[66];
nurbsPlaneShape1.controlPoints[79].yValue = \$disp[67];
nurbsPlaneShape1.controlPoints[78].yValue = \$disp[68];
nurbsPlaneShape1.controlPoints[77].yValue = \$disp[69];
nurbsPlaneShape1.controlPoints[76].yValue = \$disp[70];
nurbsPlaneShape1.controlPoints[75].yValue = \$disp[71];
nurbsPlaneShape1.controlPoints[74].yValue = \$disp[72];
nurbsPlaneShape1.controlPoints[73].yValue = \$disp[73];
nurbsPlaneShape1.controlPoints[72].yValue = \$disp[74];
nurbsPlaneShape1.controlPoints[71].yValue = \$disp[75];
nurbsPlaneShape1.controlPoints[70].yValue = \$disp[76];
nurbsPlaneShape1.controlPoints[69].yValue = \$disp[77];
nurbsPlaneShape1.controlPoints[68].yValue = \$disp[78];
nurbsPlaneShape1.controlPoints[67].yValue = \$disp[79];
nurbsPlaneShape1.controlPoints[66].yValue = \$disp[80];
nurbsPlaneShape1.controlPoints[65].yValue = \$disp[81];
nurbsPlaneShape1.controlPoints[64].yValue = \$disp[82];
nurbsPlaneShape1.controlPoints[63].yValue = \$disp[83];
nurbsPlaneShape1.controlPoints[104].yValue = \$disp[84];
nurbsPlaneShape1.controlPoints[103].yValue = \$disp[85];
nurbsPlaneShape1.controlPoints[102].yValue = \$disp[86];
nurbsPlaneShape1.controlPoints[101].yValue = \$disp[87];
nurbsPlaneShape1.controlPoints[100].yValue = \$disp[88];
nurbsPlaneShape1.controlPoints[99].yValue = \$disp[89];
nurbsPlaneShape1.controlPoints[98].yValue = \$disp[90];
nurbsPlaneShape1.controlPoints[97].yValue = \$disp[91];
nurbsPlaneShape1.controlPoints[96].yValue = \$disp[92];
nurbsPlaneShape1.controlPoints[95].yValue = \$disp[93];
nurbsPlaneShape1.controlPoints[94].yValue = \$disp[94];
nurbsPlaneShape1.controlPoints[93].yValue = \$disp[95];
nurbsPlaneShape1.controlPoints[92].yValue = \$disp[96];
nurbsPlaneShape1.controlPoints[91].yValue = \$disp[97];
nurbsPlaneShape1.controlPoints[90].yValue = \$disp[98];
nurbsPlaneShape1.controlPoints[89].yValue = \$disp[99];
nurbsPlaneShape1.controlPoints[88].yValue = \$disp[100];
nurbsPlaneShape1.controlPoints[87].yValue = \$disp[101];
nurbsPlaneShape1.controlPoints[86].yValue = \$disp[102];
nurbsPlaneShape1.controlPoints[85].yValue = \$disp[103];
nurbsPlaneShape1.controlPoints[84].yValue = \$disp[104];
nurbsPlaneShape1.controlPoints[125].yValue = \$disp[105];
nurbsPlaneShape1.controlPoints[124].yValue = \$disp[106];
nurbsPlaneShape1.controlPoints[123].yValue = \$disp[107];
nurbsPlaneShape1.controlPoints[122].yValue = \$disp[108];
nurbsPlaneShape1.controlPoints[121].yValue = \$disp[109];
nurbsPlaneShape1.controlPoints[120].yValue = \$disp[110];
nurbsPlaneShape1.controlPoints[119].yValue = \$disp[111];
nurbsPlaneShape1.controlPoints[118].yValue = \$disp[112];
nurbsPlaneShape1.controlPoints[117].yValue = \$disp[113];
nurbsPlaneShape1.controlPoints[116].yValue = \$disp[114];
nurbsPlaneShape1.controlPoints[115].yValue = \$disp[115];
nurbsPlaneShape1.controlPoints[114].yValue = \$disp[116];
nurbsPlaneShape1.controlPoints[113].yValue = \$disp[117];
nurbsPlaneShape1.controlPoints[112].yValue = \$disp[118];
nurbsPlaneShape1.controlPoints[111].yValue = \$disp[119];
nurbsPlaneShape1.controlPoints[110].yValue = \$disp[120];
nurbsPlaneShape1.controlPoints[109].yValue = \$disp[121];
nurbsPlaneShape1.controlPoints[108].yValue = \$disp[122];
nurbsPlaneShape1.controlPoints[107].yValue = \$disp[123];
nurbsPlaneShape1.controlPoints[106].yValue = \$disp[124];
nurbsPlaneShape1.controlPoints[105].yValue = \$disp[125];

I found this :) only Im not too sure how to use it as it is, I think it may be missing setAttrs and other commands as I copied this from a scene file I had rather than a mel script.

Bernard397
05 May 2008, 03:02 PM
Hello Aikiman,

I found the mel script, it's called OceanNurbsPreviewPlane.mel.

Now I must find out the expressions to emit particles, based on velocity of the wake.

Man, that's a though one....

thanks,

bern

CGTalk Moderation
05 May 2008, 03:02 PM
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.

1