I’ve had a bit of a play with the animated waves, and tried to give the impression of interaction between an object and water.
I added a function to the script to make a boat hull shaped splash. I felt that otherwise it looks artificial - I probably should do another animation without calling the addBoat() function, and compare them:
/* Function: $addBoat( float $x, float $y, float $direction, float $length, float $width )
*
* x,y - Center of boat
* direction - direction boat is pointing
* length - length of the boat
* width - width of the boat
*/
If you set the width to the same value as the length, then your boat is a coracle, or Rover from The Prisoner, as I have animated! (Well a sphere is a lot easier to model than a boat!)
Having the ball bobbing around a bit would help with the realism.
The function adds a number of decaying wave sources around the periphery of the boat:
$DecayingWaveOrigins.push( ($x + $len_x * $dy - $len_y * $dx,
$y + $len_x * $dx + $len_y * $dy,
1, 12) ); // amplitude, wave lengthThe last two parameters set the wave height and the wave length.
Anyway here is the result:
[/youtube]
I notice that the video on YouTube isn’t as sharp as the video I uploaded. I have been using the “Intel IYUV codec” for video compression. Is there a better choice for uploading to YouTube?