How to make a cmod mesh from virtually any 3D model

All tutorials about Celestia go in here. For Celestia itself, add-ons, textures, scripting, etc.
Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

How to make a cmod mesh from virtually any 3D model

Post #1by john71 » 08.01.2021, 15:27

Steps:

1.) find the object's model and download it (if it's legally possible). It can be virtually any type of 3d mesh

2.) if Blender can import it, then import it into Blender

3.) use MeshLab to open the 3D mesh if Blender can't import it and save it as an .obj mesh

4.) import it into Blender and use the "decimate" effect, if it has more than 64k vertices (.3ds meshes cannot deal with too many vertices). Save the decimated mesh as an .obj mesh

5.) use MeshLab to convert the .obj format into .3ds format

6.) use the 3ds to cmod convert and fix utility with the "Output as Ascii" option to create the cmod file

7.) open the Ascii cmod file in Notepad++ and edit it like this:

material
diffuse 0.878431 0.878431 0.878431
specular 1 1 1
specpower 128
texture0 "****name of the texture****.dds"
end_material

8.) make a dds texture with Gimp (max 8192x8192 pixels)

9.) put the cmod file in the models folder, the dds file in the textures/medres folder.

I hope I didn't left out anything...

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #2by john71 » 09.01.2021, 10:24

Method number 2:

1.) Convert the mesh into .obj format

2.) Open the .obj format with cmodview

3.) Save the opened mesh using the cmod format

4.) Open the cmod mesh with the 3ds to cmod convert and fix utility and use the "Fix" function with the "Output as Ascii" option to create a new, Ascii cmod file

5.) Open the Ascii cmod file in Notepad++ and edit it like this:

material
diffuse 0.878431 0.878431 0.878431
specular 1 1 1
specpower 128
texture0 "****name of the texture****.dds"
end_material

6.) Make a dds texture with Gimp (max 8192x8192 pixels)

7.) Put the cmod file in the models folder, the dds file in the textures/medres folder.

Avatar
trappistplanets
Posts: 641
Joined: 11.06.2020
Age: 17
With us: 3 years 11 months

Post #3by trappistplanets » 14.01.2021, 17:25

it doesn't need to be a DDS texture
you can also use png and jpg textures too
There is a limit to how far we can travel into the stars.
Owner of "The Grand Voyage" addon series
Collaborating with Dangerous_safety for the still developing Cer system

Avatar
Anthony_B_Russo10
Moderator
Posts: 672
Joined: 03.07.2018
Age: 21
With us: 5 years 10 months
Location: Tallahassee, Florida, US

Post #4by Anthony_B_Russo10 » 14.01.2021, 17:37

.DDS textures are how he gets really hi res textures.
Anthony B. Russo, I like Pluto. Mod of the Celestia subreddit: https://www.reddit.com/r/Celestiasoftware/
I have over 40 computers, trying to list them here would be a pain.
Responsible for the NEO catalog: https://celestia.space/forum/viewtopic.php?f=23&t=22203
And mod of the Discord server.

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #5by john71 » 16.01.2021, 19:15

Every video card likes DDS textures. It loads way faster.

onetwothree
Site Admin
Posts: 704
Joined: 22.09.2018
With us: 5 years 7 months

Post #6by onetwothree » 16.01.2021, 19:32

Not every. Some mobile and embedded don't like them that's why we have software decoding for DDS textures as a fallback.

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #7by john71 » 16.01.2021, 19:54

Png and jpg textures caused constant crashes on Celestia 1.6.1, so I had to convert them into dds. The crashes disappeared. Now I mostly use 8192x8192 pixels dds tiles and it is flawless. But then again I have a PC and I use Win64 + Celestia 1.6.2 with 40GBs of add-ons.

Topic author
john71
Posts: 1004
Joined: 10.08.2016
With us: 7 years 9 months

Post #8by john71 » 21.01.2021, 12:20

Method number 3:

1.) convert the mesh into obj. format using Blender or MeshLab or 3D Builder

2.) install the cmod plugin in Anim8tor 1.x https://www.classe.cornell.edu/~seb/celestia/modelling.html#4.1

3.) import the obj. mesh into Anim8tor and convert it (export it) using the cmod plugin format.


Return to “Tutorials”