Before we start the lesson, you will need the following:Original by Taskforce 58. Files that need to be downloaded have been uploaded by Vandal but all credit goes to TF58
- these files
- ActivePerl installed on your computer.
- SRFTEX.PL (remember that you also need SurfData.pm for srftex to work properly!)
- Gepolyx and GepolyO
- The suzy tools srfmerge.exe, and possibly srfmove.exe (if you don't like using gepolyO to move a model).
- Some kind of DNM management tool. You can get by with just a text editor, but only if you like to suffer. I use the perl script DNMbuild.
The bulk of the work in using srftex is actually not the perl script itself, but the prep work you need to do on the decal beforehand.
First of all you need to prepare your base surface. Most of the time this will just be the aircraft model itself, although if your model is fairly complicated, it might be a good idea to extract just the polygons defining the area which the decal will be laid on.
{ see the file base.srf attached }
Make sure all the polygons on the surface which the decal will be going are flat. A polygon with only 3 vertices are always flat. Any polygon with 4 or more vertices, you will have to carefully inspect them. Any "curvy" or "bumpy" polygons (i.e. the vertices are not all lying on the same plane) will confuse srftex.
Next, you will have a decal. The decal should be oriented so that it is roughly pointing at the right direction, in our case it is lying on the Y-Z plane facing left (negative X-axis).
{ see the file decal.srf attached }
Now you have to determine the location of the decal. In this example, I have determined that it should be located at (-3.00, 1.00, -3.20).

You have to position the decal so that it is floating just above the spot it is on. In this case, the Y/Z value of 1.00/-3.20 is the desired location. The X value of -3.00 is not as critical, as long as it place it "above" the surface - it could just as easily be -2.50 or -3.50 .
Once you have the right location, move the decal there.
{ see the file decal_moved.srf attached }
Now merge both the moved decal and the base together.
{ see the file _Merged.srf attached }
Now look at the merged files in gepolyx, using a view directly from the left:

The most critical part of this lesson is that we have to cut the decal along the edges of all the polygons that made up the base. I have highlighted those edges in green here:

After the cuts...

{ see the file decal_after_cut_with_base.srf attached }
Once the cuts are done, delete everything except your decal, and save.
{ see the file decal_cut.srf attached }
Now we can move on the the script itself. Start srftex.pl, and you should see a window like this:

On the first section "Files", select your base model for the "Base" box, and your cut decal for the "Texture" box.
For the "Axis" section, if you are:
- putting a decal on the left/right of the base model, such as a decal on the fuselage, use the "Right or Left" option.
- putting a decal on the top/bottom of the base model, such as on top or below an aircraft's wings, use the "Top or Bottom" option.
- putting a decal on the front/rear of the base model, such as how the USN sometimes paint the aircraft's number on the nose of a helicopter, use the "Front or Back" option.
For the "Side" section, this is a refinement of the "Axis" section. If you are putting the decal on the left of the base model (i.e. "Right or Left" on the "Axis" section), or if you are putting the decal on the bottom of the base model (i.e. "Top or Bottom" on the "Axis" section), or if you are putting the decal on the back of the base model (i.e. "Front or Back" on the "Axis" section), select the "Left or Bottom or Back" option. Otherwise you have to select the other.
In the last "Option" section, clear both check boxes.
Once you get all the options set, click on "Create", and after a short while it will tell you it has completed the operation. You will now get a new file with the name in the following format:
_{name of decal}_on_{name of base}.srf
Since our decal is "decal_cut.srf", and the base is "base.srf", srftex will give us "_decal_cut_on_base.srf". This is the decal, with the cuts, with all the vertices laid on the same surface as the base model.
{ see the file _decal_cut_on_base.srf attached }
Now you can put this into your dnm model as your final, contour following, decal. You need to offset the decal a little bit towards the side it is on to ensure that it will be displayed on top of the base model. In this example. since the decal is the the left of the model, I put it about 4mm offset to the left (-0.004 on the X axis).
{ see the file srftex_lecture.dnm attached }