Link : http://firstglitch.com/html_projects/sailboat/sail-gl.html<p>This is a very rough simulation of a sail boat (2D wireframe), that you can sail using force of "wind" (modeled as a million particles, animated using webgl) striking on the sails. The position of the wind particles and the forces of the particles striking on the sails is computed in WebGL shaders.<p>The forces are NOT re-calculated at each frame. Which might cause some artifacts. For example, the boat might start moving after the wind has passed, if you continue adjusting the rudder and sail angle.<p>You can adjust rudder using q/w keys and sail angle using o/p keys.<p>See if you can sail into the wind, by finding the right combination of sail angle and rudder. It is a bit hard. Adjusting rudder and sail to changing wind directions can be challenging. But it should be fun once you figure it out.
I'm sure that was hard work and I commend you for it, but as an aerospace engineer who happens to enjoy sailing (windsurfing in particular) I can't help but mention that you would get far more realistic simulation (with far less processor usage) simply by looking at the Lift-over-Drag curves for sails (or airfoils) at that regime and do a simple Forces calculation at each frame. Wind does not behave anything like particles!
simulation looks nice but the random wind is annoying: it doesn't give enough time to play with the boat and test if it does what it's supposed to. would be better with control of the wind (direction + strength).