Notes


Resizing and making a model (the 3d part) is actually pretty easy. It is making a texture that is hard. Guiding you step by step through making a model here would be beyond the scope of my message.

A) Basically you need these programs. (google them for the link)

3D part

- Wings 3d (free)

- Python (free )

- Dat2ObjTex.py and Obj2dat.py (http://svn.berlios.de/svnroot/repos/ool ... onverters/) to convert between dat and obj files and vice versa.

Skinning part

- photoshop, paint dot net, the gimp etc...

B) very basic knowledge of:

- 3d creation (make a cube or a brick and import it ingame)

- UV-mapping (flattening 3d to 2d to put a texture or skin on the 3d object)

- creating batch files or knowledge of dos commands (to convert from obj to dat and vice versa)

- image manipulation

C) imagination, precision and willpower.

You will swear often if things dont turn out in the beginning, but that is part of the learning process.

And finally a few little tips:

1)

You can open .dat and .obj files with a text editor (notepad, alleycode, dreamweaver). Lets say you have made a brick and put a texture on it in wings to bring it ingame. Make sure that all faces have a texture on them, and delete the faces on the INSIDE of the brick you are not going to be visible ingame. The conversion script will NOT add any texture to the .dat file at all if you don't and the texture will NOT show ingame.

2)

If you add light effects to your brick, make sure that you export the model with "hemispherical lighting" set as shader in wings3d. It is normally the default activated shader when you install wings 3d but should you change it to view it differently in wings be sure to put it back to hemispherical lighting under the VIEWS>SHADERS menu in wings.

If you don't your lighting will not work at all ingame.

It's always easier to create something simple to start with and test, like a brick for example. Texture it and bring it ingame.

- Also if you have Wings 3d, you should also download the (excellent and free) manifold lab plugins and install them. Google them as I don't remember the link from the top of my head. They will come handy if you want to use a Boolean operation on two objects. For example if you wanto cut a rectangular hole in a wing or something like that.

Google that in youtube as well, they have some demo videos of the plugin there.


Tip 1.

Now if you have created your brick export it as an obj file to a folder. That folder will contain 2 files:
Brick.mtl and Brick.obj. Both files can be opened with a text editor like notepad (Dont' use wordpad though). I use notepad to open the mtl file to check if it contains a texture reference. That is a reference to a bitmap file like a tga, png bmp etc. Sometimes when you export your model and there is no reference to a bitmap file in your mtl file, the converter (OBJ2DatTex.py) will not create one either and you will see no texture ingame.

You can actually change the line with the text editor without opening wings which is sometimes easy if you just want to change it from "map_Kd brick.tga" to for example "map_Kd brick.png" in a heartbeat before converting it to a dat file that Oolite will recognise.

brick.mtl example.

Code:
# Exported from Wings 3D 1.4
newmtl Brick_ship
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0
map_Kd brick.png

newmtl default
Ns 100.0
d 1.0
illum 2
Kd 0.8200000000000001 0.9049993849536925 1.0
Ka 0.8200000000000001 0.9049993849536925 1.0
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0


Tip 2

Before you start making a texture, you need to UV-Map your model. Remember paper models that you used to cut up as a kid and then fold so they would become a 3d tank or house or car etc.... well this is exactly what UV-mapping is about and what you should do to your brick only the other way round. You will make a 2D "map" of your brick cutting up the 3d model so it would fold out in 2d that you can use to draw stuff into so it will show on your texture.

There is a UV-mapping tutorial of a cube out there somewhere for wings 3d. Google it, otherwise follow these steps.

- Basically create a cube.
- Select it (so it's red) and right click
- In the menu, go to the bottom menu more->and click UV-mapping
- A window opens and then you can either AUTOmap (by projection or feature detection) or Manually, or both. (right click -> segment by)
- When you are satisfied with how the model will be cut and folded open (something you will get good at by getting your hands dirty!) You can mark edges that should be cut and change the colors on the cube. Identical colors that share a vertice or an edge will be attached to each other, so a little bit of care is necessary when choosing where to cut . Make sure there is a seperate coloured surface if you want them to be seperated on your 2d map.
-In the window with the cube having the different colors, right click again and choose continue Projection normal.

If eveything went well (no errors) you will see a window open with which is the uv editor window accessible from window->UV editor window if you close it. Remember to select something on your model or the window will not open. From this window with a right click you can create a basic texture (bmp, tga, png that will be created). You will see in your main window that your brick now has all kinds of letters painted on it. If no letters are distorted, you cut up your model correctly, if not you will have to undo your steps correct the faces texturing. Use Window-> outliner to view the default texture that was painted on your brick. You can now export that texture as an image file and change it in a Photoshop, the gimp, paint etc and save it. Import it again in wings and your cube will have the colors you put on it in your image manipulation program. The outlines of the cube on the texture "tell you" where to paint in Photoshop etc) and you can always select faces on the model and move them about in the UV-editor window, to where your texture is, it works both ways.

Then select everything and export it as a obj file to a folder and make sure that following 4 files are there in the same folder for conversion. The image goes straight to the texture folder in your oxp.


A) Brick.mtl
B) Brick.obj
C) Obj2DatTex.py
D) Convert.bat

D) create a notepad (.txt file and change the extension to bat). Call it convert.bat or something similar (make sure you have the extentions for known file types turned ON, otherwise you will see it as convert.bat, but it will actually be called convert.bat.txt and wont do a thing when double clicked exept open and show you the text you typed in) The Icon of the file should be a couple of gears on a white background, to edit it you should right click and press edit.

Now copy the line below into your batch file and save it. Obviously change brick.obj to your the filename of your model.

Code:
Obj2Dattex.py brick.obj


to convert your model from Obj to Dat you just need to double click the batch file now instead typing lines in the console.

Open your newly converted dat file with the text editor and scroll down to the bottom. If there are lines that indicate the presence of a bitmap file, the conversion was succesful and the texture (with the same name as in the dat file) and in the texture folder of your oxp will show up as it should ingame.

Tip 3

ALL, I repeat ALL faces of the model must be UV-mapped. If you encounter any popup errors in wings 3d when doing the projection normal operation in the UV-mapping window, you will have to track down the piece that has not been mapped and delete/hole/dissolve it in the main window hoping that it doesnt wreck the appearance of your model or Tesselate it if possible and try the UV mapping again.

Tip 4

It is advised to divide a complicated model in different more simple objects, and export the selected pieces as individual obj files. (use the extract menu for that purpose (right click) and the Geometry graph window (window->geometry graph ). Oolite supports the use of subentities which are different dat files dependent on another dat file. Basically it means you could have a fuselage.dat and a wing.dat and make the wing.dat a subentity of the fuselage in the shipdata.plist file of your model.

Tip 5

If you add light effects to your brick, make sure that you export the model with "hemispherical lighting" set as shader in wings3d. It is normally the default activated shader when you install wings 3d but should you change it to view it differently in wings be sure to put it back to hemispherical lighting under the VIEWS>SHADERS menu in wings.
If you don't your effects map will not show ingame.

That's about all I can say for now. It takes a little bit of time to get to know wings 3d, but by the end of the week you should be on your way.

Have fun