Lqd Posted March 31, 2022 Share Posted March 31, 2022 Hi all.. I'm trying to find the solution, how to control water (or whitewater) shape behaviour around the floating boat. I would like to obtain shape like in top picture on the left. But my results always looks something like on picture bellow, (very extensive side ripples) which I don't want to. Nobody in tutorials or PRO courses doesn't explain how to control that behaviour, if I don't want leave simulation to work 'naturally'. I think it has something to do with the custom velocity values, but I had no good result with my experiments. I saw some tutorials for Maya's or Max's PhoenixFD, where was really good looking results. So, does anybody know, which parameter, feature or node is responsibile to control that, if I want to avoid natural behaviour and obtain the shape like on top left on the picture? ps: The top picture simulation made somebody in Houdini (all boat floats is 58 km/h) with some personal 'KA_wave' tool, which doesn't exist for commercial use. ..I can pay for explanation or shared example hip file.. Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 2, 2022 Share Posted April 2, 2022 (edited) @Lqd You can use kelvin wake vex and try to combine with force and "whitewater" somehow. #define PI 3.14159265 #define e 2.718281828459045 #define PI 3.14159265 #define e 2.718281828459045 #pragma label origin "Origin" #pragma label rotation_angle "Rotate" #pragma range rotation_angle 0 360 #pragma label height "Wave Height" #pragma label maxIterations "Numer of Iterations" #pragma label width "Boat Width" #pragma label length "Boat Length" #pragma label c "Boat Speed" #pragma label t "Boat Draught" float sec(float angle){ return 1/cos(angle); } float D(float k,d,theta){ float res = sec(theta); res = -1*k*d*res*res; res = pow(e, res); res = 1-res; return res; } float evaluate (float x_coord, z_coord, c, l, t, angle) { float K, A, B, C, D, E, F, G, H, I, J; K = c / 96.2361; //k = c / g^2 A = (c*c)/(9.81*l); // = c^2/gl B = K*(1+(tan(angle)*tan(angle))*(x_coord*cos(angle)+z_coord*sin(angle))); C = K*(1+(tan(angle)*tan(angle))*((x_coord+l)*cos(angle)+z_coord*sin(angle))); D = D(K,t,angle); E = A*D*sin(B); // = A.D.sin(B) F = -4*A*A*D*cos(angle)*cos(B); // = -4.(A^2).D.cos(angle).cos(B) G = -6*A*A*A*D*(cos(angle)*cos(angle))*sin(B); H = -2*A*A*D*cos(angle)*cos(B); // -2.(A^2).D.cos(angle).cos� I = 6*A*A*A*D*(cos(angle)*cos(angle))*sin(B); J = E+F+G+H+I; return J; } float calcR(float angle) { float r; float len = .001; // Skip the singularity if (abs(angle) <0.000001) { r = 0.0; } else { r = len/angle; } return r; } sop ssh_kelvin_wake_2(int maxIterations = 80; vector origin = 0; float rotation_angle = 0; float height = 1.0; float width = 6.0; float length = 40; float c =15.0; float t = 1.0; float bend_angle = 0) { float sum=0; float freqs = maxIterations; int i = 1; float h = PI/(2.0*maxIterations); float b = width/2.0; float l = length/2.0; float g = 9.81; float b_mult = 27*b/(2*PI); float theta; float range = 90; vector currentPoint = P-origin; float rotatingAngle = -radians(rotation_angle); float px = currentPoint.x * cos(rotatingAngle) - currentPoint.z*sin(rotatingAngle); float pz = currentPoint.x * sin(rotatingAngle) + currentPoint.z*cos(rotatingAngle); float angle = atan2(pz,px); float modAngle = abs(angle)%radians(360.0); float angleThreshold = radians(45.0); if(abs(angle) <=angleThreshold ) { matrix rotationMatrix = ident(); vector axis = set(0,1,0); rotate( rotationMatrix, radians(rotation_angle), axis); currentPoint *= rotationMatrix; for(i = 1; i<=maxIterations; i++) { theta = radians(((freqs/2.0)-i) * (range/(freqs/2.0))); sum += radians(evaluate(currentPoint.x, currentPoint.z,c,l, t, theta)*(range/maxIterations)); } vector deform = 0; deform.y = -b_mult*sum*height; deform.y *= fit((abs(angle)%radians(180.0)),.7*angleThreshold,angleThreshold, 1.0, 0.0); P += N*deform; } } Edited April 2, 2022 by Librarian Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.