|
|
Open up Meshwork and change a couple of settings - we'd like to see the grid, so click that, and select Blueprint view. |
|
|
Our ship is going to be based on a simple 8 sided cone, which we create with height 60, and diameter 40, and a closed base. |
|
|
Here's the cone, we've zoomed in a bit so it's easier to see. Oolite ships are aligned to point along the z-axis, so we need to rotate this 90 degrees. We need to have all the points selected (red) before we do this. |
|
|
Choose to rotate about the origin (0,0,0), 90 degrees around the x-axis. |
|
|
Here's our basic cone ready to become a ship. |
|
|
We want to stretch out the base a bit, so we select the central point... |
|
|
... and pull it along the z-axis a little. Now our cone is more of a 'spinning-top' shape. |
|
|
We want to flatten the shape somewhat (as if it has been sat upon), this will affect the whole shape so we need to select all the points again. |
|
|
And apply a 50% scale in the y dimension. Note that once again we are scaling from the origin (0,0,0). |
|
|
The result is a flattened spinning top shape. We're through changing the geometry at this stage. If you haven't done so yet, now's a good time to save! |
|
|
We saved as oogie.mesh, now we can consider texturing. First we select points that will be part of the top of the ship and will have a single texture file. Here we use the front top quarter of the ship. |
|
|
We assign these points and triangles one of the material colors, in this case dark blue, by clicking the dark blue materials box in the top-right. |
|
|
Now the same, but on the underside. |
|
|
We assign these points and triangles the light blue material. |
|
|
Thirdly, the rear section of the ship. This will be all one texture. |
|
|
We assign these to the green material, and save the file again. Now we can choose how those materials will be applied, which will set our basic texture coordinates. Deselect all the points (or we'll end up assigning materials to points we don't necessarily want), then double click the blue material box... |
|
|
First, we supply a texture name oogie_top.png then select a way for it to be applied. We choose planar projection along the Y axis and hit 'Set:' to place the texture mapped pints as wide as possible. Then press 'OK' |
|
|
The bottom material, light blue, gets oogie_bottom.png, but the same projection as the top. |
|
|
The green, rear materal, gets oogie_rear.png, but this time we choose a planar projection along the Z axis. That's set all the points projections but it hasn't set any 'u-v' coordinates for the textures. We do this by taking each material in turn again and setting the Mapping to Pinned |
|
|
Pinned top, |
|
|
pinned bottom, |
|
|
and pinned at the rear. |
|
|
At this stage I like to open the texture map window for each material and take a snapshot (command-shift-4 then press space, move the camera over the window and press space again), so I have a reference for when I create the textures. |
|
|
The model is complete at this stage, and we can use 3d preview to look at how the untextured model will appear. |
|
|
Next, we have to convert the model for use in Oolite. Before going on we may want to tidy up the Meshwork file a little. Open up the saved Meshwork file by dragging it into TextEdit. There you can round values that are close to integers to their integer equivalents (for example, -0.0000006 should become 0). |
|
|
When you are ready you can drag the Meshwork file to DropMesh2DatTex, which will produce the equivalent oogie.dat file. You can open this file in TextEdit too, to make any changes you feel necessary at this stage, or just to examine the file structure. |
|
|
To create the textures, I took the snapshots I had from the Texture Map earlier, trimmed off the top and bottom, and dragged them into my art package. I use Omnigraffle for creating skins, but Photoshop, The Gimp, Painter or any other art package should* do just as well. This is the Omnigraffle file for this tutorial. *It seems Meshwork has some problems with png files from Photoshop, causing parts of ships to disappear. If this happens, try a different file format when copying art into Meshwork. The Photoshop png files should still work just fine with Oolite
|
|
|
Once I was happy with the textures, I exported them as oogie_top.png, oogie_bottom.png and oogie_top.png, all at 256x256 pixels. You'll notice that the textures have been flipped in the vertical axis from the arrangement in Meshwork's texture map. This is because the texture 'u-v's created by DropMesh2DatTex are flipped (a feature I haven't yet corrected). |
|
|
Then I could re-open the Meshwork file and copy and paste the textures into the material dialogs. With the textures imported back into the Meshwork model, we can take snapshots of it at will. This is a final test of the model before it can be used in Oolite. |
| The final stage is to move the files into the appropriate places and create a shipdata.plist entry for the new ship. oogie.dat should go in AddOns/Models/ oogie_top.png, oogie_bottom.png and oogie_top.png should go in AddOns/Textures/ The entry in shipdata.plist should look something like this:
<key>my_oogie_ship</key>
<dict>
<key>ai_type</key>
<string>pirateAI.plist</string>
<key>bounty</key>
<integer>150</integer>
<key>cargo_type</key>
<string>CARGO_NOT_CARGO</string>
<key>energy_recharge_rate</key>
<real>4</real>
<key>exhaust</key>
<array>
<string>0.0 0.0 -6.5 8.0 8.0 12.0</string>
</array>
<key>forward_weapon_type</key>
<string>WEAPON_PULSE_LASER</string>
<key>has_ecm</key>
<true/>
<key>has_escape_pod</key>
<true/>
<key>has_scoop</key>
<false/>
<key>likely_cargo</key>
<integer>0</integer>
<key>max_cargo</key>
<integer>0</integer>
<key>max_energy</key>
<real>300</real>
<key>max_flight_pitch</key>
<real>1</real>
<key>max_flight_roll</key>
<real>1.75</real>
<key>max_flight_speed</key>
<real>250</real>
<key>missiles</key>
<integer>0</integer>
<key>model</key>
<string>oogie.dat</string>
<key>name</key>
<string>Oogie Boogie Ship</string>
<key>roles</key>
<string>pirate</string>
<key>thrust</key>
<real>20</real>
<key>weapon_energy</key>
<real>25</real>
</dict>
If this entry is added to shipdata.plist, in AddOns/Config then because it has the roles key set to 'pirate', when pirates are added to a system the oogie ship will be among the ships that are considered.
|
|