Preparing Models for Celestia

All tutorials about Celestia go in here. For Celestia itself, add-ons, textures, scripting, etc.
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 11 years 5 months
Location: Germany

Preparing Models for Celestia

Post #1by FarGetaNik » 12.08.2016, 19:58

I just want to share with you how I create models for Celestia, maybe this could be useful for someone since it took my much effort to learn this. Also I'd appreciate any tips to improve this process, I'm still struggling with some flaws. I will explain the process on the example of the Dawn spacecraft and Epimetheus. Note: I'm working on Windows 10.

Tools necessary:
cmod export script for Anim8or: - update 2022: new version here
Blender and Anim8or need some time to learn, cmodview is very simple and should not make any trouble.

Download a suitable model
I have no talent in creating models myself, so I rely on sources to get a suitable model. For solar system objects, I recommend the 3D asteroid catalogue by Greg Frieger: and for spacecraft NASA's 3D resources:

Blender: Convert model to OBJ
If the model is in any format Anim8or can't handle (mostly spacecraft in .blend format) open it with Blender first. Click File/Export/Wavefront (.obj) to create an obj file for Anim8or. This is necessary, because I have no working cmod converter for Blender running on Windows, but only for Anim8or.
Here comes the first flaw: Blender creates a yet invisible cube, as you can see in the materials in the screenshot. I can't delete it.

Anim8or: Texturing the model
Open all textures of the model (except the normal maps) in your graphic manipulation software of choice and export them as jpg, since Anim8or can’t handle png. You can later use these textures in Celestia as well, except png is more suitable (for featureless textures png compression is more effective).
Open the obj in Anim8or. Switching to the materials menu, we see that the invisible cube converted itself into a now visible, still useless cube. On Dawn it's inside the mesh, because the spacecraft itself is cubic. Open the cube’s material (usually on the top) and set transparency to 0 (deleting it corrupts the model). Then open each material by double-clicking on it and assign the correct texture to it. This is done by clicking on the 'T' next to diffuse and clicking on “Load Texture” in the new window. Then select the texture with the name fitting the material.

If you are not working with a spacecraft but rather a small body model from the asteroid catalogue, you will have to rotate the model first. The x-axis should be the longest. Unlike in Celestia, in Anim8or the polar axis is y and should be shortest. If your object is a tidally locked satellite, you might want to make sure the mesh is rotated around the polar axis the right way by comparing it to its Celestia counterpart or spacecraft imagery. Then you have to assign a texture to the model, or it will be impossible for Celestia to render ANY texture to it. This is again done by selecting the model and switching to materials. Double-click on “New” and click on the button next to “Diffuse” and proceed as described above. Click “Apply” on the material. The mesh might change color, but the texture is not rendered yet. Click on “UV” on the left and confirm, then double click anywhere to let a window appear to select “Spherical projection”, the texture should now be rendered. You are able to rotate the texture to align it to the features of the mesh if necessary.

Export to CMOD
As finished, export the model to cmod. 2 files are created, one for materials and one for the mesh. Open both. You may delete any unnecessary comments and stick the content of *.cmod_mesh after the content of *.cmod_material, saving it with the file extension .cmod. We now have a raw ASCII cmod, which already can be used in Celestia, but fine-tuning is recommended. For the next step, you have to put it into a models folder and make sure the textures (including normal maps) are present in a folder structure where Celestia would expect them:
put cmod in here:
put all textures in here:

Edit in cmodview
When successful, the cmod can be loaded with cmodview. If not, you will get an error, if so you need to retry to stitch the exported files together. Using such a file in Celestia might cause a crash.
We now can edit specular power and color, which is displayed material for material in Blender, select the respective material, which is now highlighted in green, and edit specular data on the right. If you are unlucky, the invisible cube obscures some materials. For solar system bodies, you might want to remove the texture, or Celestia will always load the assigned texture if not told otherwise by an ssc.
Also, a normalmap can be assigned to the model: Click on Operations/Generate tangents... and then on Operations/Uniquify Vertices. Again by clicking on individual materials you can select a normalmap if one is present in the right folder. For solar system objects, you might also want to select a diffuse color corresponding to the true color and albedo. Saving the model converts it into a binary cmod. It is now ready for use in Celestia.

Dawn model featuring specularity and normalmap in Celestia:

Return to “Tutorials”

Who is online