
Show HN: A rough simulation of a sail boat (2D Wireframe) - imakesnowflakes
Link : http:&#x2F;&#x2F;firstglitch.com&#x2F;html_projects&#x2F;sailboat&#x2F;sail-gl.html<p>This is a very rough simulation of a sail boat (2D wireframe), that you can sail using force of &quot;wind&quot; (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&#x2F;w keys and sail angle using o&#x2F;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.
======
teleclimber
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!

~~~
imakesnowflakes
Yes. I had considered that option. But hey, I just wanted to see if I can pull
this off...

------
jml3on
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).

~~~
imakesnowflakes
But that is the fun part. If wind can be controlled, one can just make it blow
from behind and keep the sail perpendicular to the wind, to move in any
required direction.

Anyway, I have turned off randomizing wind directions at load and have added a
check box to enable/disable it.

