Show HN: A rough simulation of a sail boat (2D Wireframe)

6 points by imakesnowflakes ↗ HN
Link : http://firstglitch.com/html_projects/sailboat/sail-gl.html

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.

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.

You can adjust rudder using q/w keys and sail angle using o/p keys.

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.

4 comments

[ 4.4 ms ] story [ 23.4 ms ] thread
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).
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.

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!
Yes. I had considered that option. But hey, I just wanted to see if I can pull this off...