Making your own Mesh Sails

Building your own Ship
Setting the NC parameters in a Sailboat
Setting the NC parameters in a Motorboat
Adding Sails to your Ship.
Customizing the HUD.

Using the main navigation page of the HUD.
Instructions on how to control your boat.
Hints on how to sail a boat.
Setting up your sailboat.

It is possible to make your own mesh sails and use the scripts from my sails to bring them to life. Right now you probably have to come talk to me, but I hope this document will be expanded until a good mesh maker can make a working sail without bugging me.

The first rule is DO NOT JUST BUILD A SAIL AND THEN TRY TO CONVERT IT. You will have to build the sail to fit into the limits mentioned below. Some of the limitations were created by me when I wrote the sail scripts, but most of them are limits of OpenSim or the viewer so you must obey these.

To make the sails rotate nicely I always build my sails as a single mesh prim. There are a few exceptions and ways around this, but they may add lag to the server so I avoid that. For example, the furled sail cover can be part of the whole single mesh prim sail, but since it never rotates you could make it a separate prim. A very simple script could listen for the instrument messages that raise and lower the sail and just make the sail cover invisible and visible. I have a script that does this and would gladly give you a copy. The entire sail script can be convinced to do this but it would be laging the server checking for other sail functions. It is possible to split the sail into several separate child prims, put the entire sail script in each and convince the to work at separate times. (How do you convince the script to do this? By carefully making lists of faces as described below). This adds extra vertexes to the sail and adds another script to the build, two things that I perfer to avoid.

A mesh prim is only allowed to have 8 “materials” or faces. To animate the sails I make each different part of the sail a different material and this rapidly uses up all 8 materials. To make the sails rotate smoothly, I have to use one material to make a “counterweight” on each sail. So now you only have 7 left. I build the sails curved left and right, so that doubles the number of materials needed. My scripts allow the sails to be full or reefed half way, and that doubles the number of materials again. I think you should try to keep your builds small to be kind to the system, so if your sail has a boom folded up or furled shape, you should only have those once in the prim and share them with the other parts. For example, a Bermuda sail could have a full sail left and right, a reefed sail left and right, a folded up sail, a boom and a counterweight. That is 7 materials and we are about out. When the sail is up, the boom is also visible. When the sail is reefed the folded up sail is also visible to create the illusion of half the sail tied to the boom. When the sail s furled the boom and folded sail are the only materials visible. If I had more materials, I would ad a pair of wrinkled sails to show the sail fluttering when not trimmed well. Then I need two more for fluttering the reefed sail. A separate material for the half-folded sail when reefed would be nice.

Axes and Location of the Counterweight

In Blender and other 3D modeling programs, you can specify the center of rotation of an object, but the DAE mesh loader in OpenSim ignores this setting! I want the sails to rotate nicely so I wanted to find a way to make them rotate around a chosen point. Yes, you can make a prim rotate around any arbitrary point by writing the script to translate and rotate at the same time. But when you do this the viewer interpolates the position and rotation linearly at the same time, and this can prodce visually unplesant intermediate positions. Building the sail to rotate around a chosen point produces a much nicer more consistant rotation. (And it makes the script for doing that rotation easier). There is apparently a rare error, probably a lost packet on the Internet, that can cause the translation or the rotation to happen alone. This causes the sail to separate from its correct position or rotation around the mast. A single rotation request cannot get broken up like this and the sails never do this ugly separation.

My solution to this for for-and-aft sails was to put an extra face, a single quadrangle, exactly the same distance in front of the sail as the back end of the boom. this makes a Bermuta sail to rotate exactly around the edge where it is placed along the mast. Note that for hysterical reasons, the fore-and-aft sails are made with their local Y axis pointing opposite from the boom. So when the sail is hanging directly behind the mast, the Y axis points forweard on the boat, and the counterweight is in front of the mast. The local Z axis points up along the leading edge of a Bermuda sail, and the local X azis points sideways when the sail is hanging directly behind the mast. For Lateen, Lug and Gaff, you must choose the location where you want the sail to attach to the mast, and balance the counterweigh forward from that point. So parts of the sail can be in front of the mast when the boom or yardarm is hanging straight back behind the mast.

My solution for jib sails was to have the local Z axis runs along the halyard (the wire or rope that the leading edge of the jib rotates around). The local X axis points sideways when the jib is hanging straight back from the halyard. The local Y axis is pointing up and forward, the opposite direction that the sail is hanging. The counterweight to make it rotate nicely around the halyard must be placed along the positivwe Y axis, a distance equal to the distance that the far corner hangs.

My solution for square sails was to have the local Z axis pointing up paralell to the mast. The X axis is pointing forward when the sail is perpendicular to the boat (as when the wind is directly behind the boat). The local Y axis is pointing paralell to the yardarm. The counterweight has to be far enough behind the sail to "counteract" the curved shape of the full square sail. I like to place it a little farther back so the yardarm rotates a little in front of the mast. This prevents the yardarm from passing through the mast and is a pretty realistic placement.

Assigning Face Numbers for the Script

If you want to build a fore-and-aft sail that uses my script, you will need a separate material (face) for the counterweight, boom, furled sail or cover, two faces for the full sail (left and right) and two faces for the reefed sail. When you make a mesh object, it is difficult to force a particular material to have a particular face number. In addition, I have found that different versions of OpenSim assign the face numbers in a different order. So after you have built a sail, you need to tell the script which face is which part of the sail. You do this by adding lines to the .sailparams NC to tell it which group of faces to make visible for each possible state of the sail. Here are the values for one of my gaff sails:
The list of faces that must be on when furled (lfirled) is 5,2,0. On that sail, 0 is the face number of the boom, 2 is the face number of the folded up sail, and 5 is the face number of the a yardarm that sits on top of the folded sail. These three are visible when furled, no other parts.

When reefed on the left side of the mast, the face that looks like a sail on the left is number 6. This face also includes a copy of the yardarm at the top of the sail. 0 is the boom, which you will see is shared by all the states of the sail. I asked for face number 2, which is the folded sail, to show half of the sail folded up on top of the boom. This is actually the same as the whole sail folded up, but without the yardarm on top of it.

When the sail is reefed and the wind blows it onto the right side of the boat, the only difference from the left side is face 7 instead of face 6.

Face number 3 is the full sail on the left side of the boat. It has a yardarm on top so all it needs is to have the boom (0) visible at the same time.

When the wind blows the full sail over to the right side, the only difference is face 3 is replaced by face 4.

Example of a Jib Sail

A jib sail has no boom or yardarm so it has fewer materials than a for-and-aft sail. Here is an example from the .sailparams NC for one of my jib sails:
My furled jib sail is face number 0. The reefed sail left (3) and right (4) are displayed with the furled sail so it looks like part of the sail has been rolled or tied up. The full sail on the left (1) and right (2) are visible just by themselves. The "lnotex" line is a list of faces that don't change textures with damage. 0 is the furled sail, and 5 is the counterweight.

Example of a Square Sail

Because the square sail turns straight down wind when it can, there is no left and right version of it. So I went hog wild and added faces that show the sail wrinkled and switch back and forth between pairs of them when the sail cannot catch the wind. I ran out of materials anyway, and switch between one wrinkled and one inflated versions of the reefed sails to show fluttering without wind.
lfurled=[4,7];      //which faces must be visible when furled
lreefed=[4,5,7];    //which faces for reefed
lreeff1=[4,5,7];    //reefed flutter 1
lreeff2=[4,6,7];    //reffed flutter 2
lfull=[1,7];        //full sail
lfullf1=[2,7];      //full flutter 1
lfullf2=[3,7];      //full flutter 2
lnotex=[0,7];       //which faces don't have damage textures

Limiting the Number of Vertexes

Something that bugs me is seeing triangular sails that are made by taking a rectangle, subdividing it until it has enough faces, then pinching it into a point at the top. This concentrates lots of vertexes up at the top of the sail where they are wasted geometry. Learn to use Blender (or whatever). Make your sail by subdividing a triangle so it has the same amount of geometry at all the points. This typically cuts the number of vertexes in HALF.

Sails need to have a front and a back surface to be visible from all angles in OpenSim. But sails do not need to be “solidified”. They do not need to have quadrangles made to stitch the left and right sides together. A sail can just be two separate sheets of quads or triangles, (both sides part of the same material), very close to each other, with normals facing in opposite directions.