Convert 3d file into cmod with texture

All about models for Celestia. How-to, programs, work in progress...
Topic author
Alejandro
Posts: 12
Joined: 25.10.2018
With us: 6 years 1 month

Convert 3d file into cmod with texture

Post #1by Alejandro » 25.10.2018, 17:32

Hi Everyone:
I found this nice vesta 3ds model but I´m afraid I cannot load texture when running into Celestia;
https://nasa3d.arc.nasa.gov/detail/asteroid-vesta
Can everyone convert it to cmod or make this 3ds able to load texture and not only the naked 3D model?
Thanks a lot!

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #2by Limax7 » 26.10.2018, 10:00

Alejandro wrote:Hi Everyone:
I found this nice vesta 3ds model but I´m afraid I cannot load texture when running into Celestia;
https://nasa3d.arc.nasa.gov/detail/asteroid-vesta
Can everyone convert it to cmod or make this 3ds able to load texture and not only the naked 3D model?
Thanks a lot!


Few minutes ago I made a cmod binary model and add texture :)

Vesta_big.zip
(22.18 MiB) Downloaded 382 times
Adam Hurcewicz
Bialystok, Poland

Avatar
Diigg M
Posts: 54
Joined: 09.02.2011
With us: 13 years 10 months

Post #3by Diigg » 27.10.2018, 14:20

@Limax27, the texture seems not fit according to the model. It looks like double...
vesta.jpg

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #4by Limax7 » 27.10.2018, 15:39

Diigg wrote:@Limax27, the texture seems not fit according to the model. It looks like double...
vesta.jpg

Yes. Some parts of the surface don't match so I try to fix that soon.
Today I try to do normalmap to this add but my son take me of from computer :insane:
Adam Hurcewicz
Bialystok, Poland

Topic author
Alejandro
Posts: 12
Joined: 25.10.2018
With us: 6 years 1 month

Thank a lot! and new line code to add color and ambient light

Post #5by Alejandro » 02.11.2018, 17:38

Thank you very much for you answer!
The model looks fine! However I would like to ask you if the mesh model you use to create this cmod file is the same as I suggested, because that 3d model is full of details!
Regarding the other user, it is true that there is a bit of "double Effect".
I would like to suggest this line that includes color for the asteroid and lunar lambert for a more realistic general light feeling (rewrite the following code at inside "asteroids.ssc" file in "Data" folder and it could be fixed this double effect we won´t be more happy!


"4 Vesta:Vesta" "Sol"
{
Class "asteroid"
Mesh "vesta_big2.cmod"
Texture "vesta.jpg"
Color [ 1.000 0.923 0.851 ]
BlendTexture true
LunarLambert 0.8
Radius 279 # maximum semi-axis
MeshCenter [ 0.77 3.424 -0.554 ]

InfoURL "http://www.solarviews.com/eng/vesta.htm"

EllipticalOrbit
{
Epoch 2452000.5 # 2001 Apr 1 00:00UT
Period 3.62729
SemiMajorAxis 2.3670775
Eccentricity 0.089753
Inclination 7.1346
AscendingNode 103.9510
ArgOfPericenter 149.4585
MeanAnomaly 104.980
}

UniformRotation
{
Period 5.342
Epoch 2450124.90833 # 1996 May 11 09:48UT
Inclination 40
AscendingNode 91
MeridianAngle 325.77
}

Albedo 0.423
}


Regars!
Alejandro

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #6by Limax7 » 02.11.2018, 18:54

Alejandro wrote:Thank you very much for you answer!
The model looks fine! However I would like to ask you if the mesh model you use to create this cmod file is the same as I suggested, because that 3d model is full of details!
Regars!
Alejandro

Yes, this is model from your suggestion https://nasa3d.arc.nasa.gov/detail/asteroid-vesta


Pozdrawiam
Adam Hurcewicz
Bialystok, Poland

Avatar
SpaceFanatic64
Posts: 427
Joined: 16.08.2018
Age: 18
With us: 6 years 4 months
Location: Southern California

Post #7by SpaceFanatic64 » 03.11.2018, 00:00

Alejandro, it's best not to modify SSC files in the data folder unless you know what you're doing. It can sometimes cause objects to not appear. You should take the code posted above and make it it's own SSC file. Use this code below, paste it into Notepad or equivalent, and name it vesta.ssc and place it in your extras folder.

Code: Select all

Replace "4 Vesta:Vesta" "Sol"
{
Class "asteroid"
Mesh "vesta_big2.cmod"
Texture "vesta.jpg"
Color [ 1.000 0.923 0.851 ]
BlendTexture true
LunarLambert 0.8
Radius 279 # maximum semi-axis
MeshCenter [ 0.77 3.424 -0.554 ]

InfoURL "http://www.solarviews.com/eng/vesta.htm"

EllipticalOrbit
{
Epoch 2452000.5 # 2001 Apr 1 00:00UT
Period 3.62729
SemiMajorAxis 2.3670775
Eccentricity 0.089753
Inclination 7.1346
AscendingNode 103.9510
ArgOfPericenter 149.4585
MeanAnomaly 104.980
}

UniformRotation
{
Period 5.342
Epoch 2450124.90833 # 1996 May 11 09:48UT
Inclination 40
AscendingNode 91
MeridianAngle 325.77
}

Albedo 0.423
}
If you see that I made a dumb or nonsensical post years ago, please forgive me in advance.

Topic author
Alejandro
Posts: 12
Joined: 25.10.2018
With us: 6 years 1 month

Post #8by Alejandro » 05.11.2018, 17:09

Thank you very much to both. One for the Vesta texture, and the other for the good advice regarding ssc!

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #9by Limax7 » 06.11.2018, 08:10

Alejandro wrote:Thank you very much to both. One for the Vesta texture, and the other for the good advice regarding ssc!

:smile:

I will try to better match texture to the cmod model but my PC is too old and I dont know can I do that ... :eh:
Adam Hurcewicz
Bialystok, Poland

Avatar
gironde M
Posts: 852
Joined: 16.12.2016
Age: 72
With us: 8 years
Location: Montigny-Les-Metz, France

Post #10by gironde » 06.11.2018, 11:33

your texture is interresting, the East-West orientation corresponds to what we see on the IAU website, my old texture was upside down. But the ssc file is a problem. When displaying the locations on the asteroid (coordinates from the IAU) there is a shift of about 20 ° to the west. Should not we correct the MeshCenter or Orientation ?


Code: Select all

Replace "Vesta:4 Vesta:1807-4*" "Sol"
{
   Class "asteroid"
   Mesh "vesta_big2.cmod"
   Texture "vesta8K.jpg"
   Color [ 1.000 0.923 0.851 ]
   BlendTexture true
   LunarLambert 0.8
   Radius 279 # maximum semi-axis
   MeshCenter [ 0.77 3.424 -0.554 ]

   EllipticalOrbit
   {
      Epoch 2452000.5 # 2001 Apr 1 00:00UT
      Period 3.62729
      SemiMajorAxis 2.3670775
      Eccentricity 0.089753
      Inclination 7.1346
      AscendingNode 103.9510
      ArgOfPericenter 149.4585
      MeanAnomaly 104.980
   }

   UniformRotation
   {
   Period         5.342
   Epoch          2450124.90833 # 1996 May 11 09:48UT
   Inclination      40
   AscendingNode   91
   MeridianAngle   325.77
   }

   Albedo 0.423
   
   InfoURL "http://www.solarviews.com/eng/vesta.htm"

}


Code: Select all

Location "Africana" "Sol/Vesta"
{
   LabelColor [ 0.380 0.663 0.725 ]
   LongLat [ 345.87 68.99 0 ] # [ 345.87 68.99 0 ]
   Size 30 # forced to 30, reality 25.43
   Type "AA"
}


:hi:
Attachments
Vesta_big.jpg

Avatar
gironde M
Posts: 852
Joined: 16.12.2016
Age: 72
With us: 8 years
Location: Montigny-Les-Metz, France

Post #11by gironde » 06.11.2018, 12:31

What to change in the ssc file:

Code: Select all

   Orientation [ 30 0 1 0 ]
   #MeshCenter [ 0.77 3.424 -0.554 ]


After modification

:hi:

Added after 1 hour 47 minutes:
the original texture vesta-topo.dds (Art Blos) does not match the orientation of your vesta8k.jpg

As an attachment, the corresponding texture (Nasa) : 11521x5761 pixel
(dimensions can be reduced if necessary)

Code: Select all

AltSurface "Topography" "Sol / 4 Vesta"
{
Texture "vesta-topo8k.jpg"
}
Attachments
vesta-topo8k.jpg
vesta-topo8k.zip
(6.17 MiB) Downloaded 350 times
Vesta_big2.jpg

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #12by Limax7 » 06.11.2018, 17:26

gironde wrote:
As an attachment, the corresponding texture (Nasa) : 11521x5761 pixel
(dimensions can be reduced if necessary)

This texture have Long=0 at the left side so must be at the center of the image.
Adam Hurcewicz
Bialystok, Poland

Avatar
Diigg M
Posts: 54
Joined: 09.02.2011
With us: 13 years 10 months

Post #13by Diigg » 06.11.2018, 17:37

Excuse me, but I'm lost.
In the end, there is some way to adjust the Vesta8K texture and the model.

@Gironde, in your screenshot, seems to be adjusted. I have made the changes you have suggested but I do not appear adjusted.
Are you using vesta8K texture?

Avatar
gironde M
Posts: 852
Joined: 16.12.2016
Age: 72
With us: 8 years
Location: Montigny-Les-Metz, France

Post #14by gironde » 06.11.2018, 17:59

it's the same alignment as the 8k texture of vesta_big
If you use the vesta_big texture, the vesta-topo.dds texture will not be aligned in the same way.

In addition the mesh should be oriented 30 ° on the y-axis as I said before, so the surface locations will be in the good place.


:hi:

Added after 7 minutes 21 seconds:
vesta8k (normal), this is the texture of the addon of limax7 viewtopic.php?p=140710#p140710

vesta-topo8k is the texture AltSurface "topography" which corresponds to it

Code: Select all

AltSurface "Topography" "Sol/4 Vesta"
{
   Texture   "vesta-topo8k.jpg"
}


:hi:
Attachments
Sans titre 2.jpg

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #15by Limax7 » 07.11.2018, 04:44

gironde wrote:
vesta-topo8k is the texture AltSurface "topography" which corresponds to it

Code: Select all

AltSurface "Topography" "Sol/4 Vesta"
{
   Texture   "vesta-topo8k.jpg"
}


:hi:

Ups, my mistake. Long=0 is in the center. Sorry :oops:
Source:
https://astrogeology.usgs.gov/search/map/Vesta/Da ... HAMO_ClrShade_DLR_Global_48ppd
Adam Hurcewicz
Bialystok, Poland

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Post #16by John Van Vliet » 07.11.2018, 07:39

for any interested back in 2014 i created a med res cmod and 4ktextures
texture and normalmap
a 21.1 Meg zip
https://drive.google.com/file/d/0B6ZYAd08tZL-RzlSX1FSc2ZjbzA/view?usp=sharing

i do have a hires 57 meg cmod ( the original obj file it was created from is 456 Meg )

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 10 months
Location: Poland, Bialystok

Post #17by Limax7 » 07.11.2018, 09:10

Thanks John. Maybe the med res cmod and normal map is the best choice for Vesta and Ceres.

I will try your model :smile:
Adam Hurcewicz
Bialystok, Poland

Avatar
Diigg M
Posts: 54
Joined: 09.02.2011
With us: 13 years 10 months

Post #18by Diigg » 07.11.2018, 21:41

for any interested back in 2014 i created a med res cmod and 4ktextures
texture and normalmap
a 21.1 Meg zip
https://drive.google.com/file/d/0B6ZYAd08tZL-RzlSX1FSc2ZjbzA/view?usp=sharing

Thank you, what ssc file are you using?

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 3 months

Post #19by John Van Vliet » 10.11.2018, 05:40

the ssc is for SPICE orbits

Code: Select all


Replace "4 Vesta:Vesta" "Sol"

{
  Class "asteroid"
  Mesh    "Vesta.Med.bin.cmod"
  # Texture ""       # coded into the cmod
  # NormapMap ""     # coded into the cmod
  Orientation [ 90 1 0 0 ] # did NOT rotate it on export to cmod
  Radius               280
  Albedo               0.2  # guess, a bit random

  OrbitFrame { EclipticJ2000 { Center "Sol" }}

  Beginning  "1900 01 01 00:00:00.000"
  Ending     "2101 01 01 00:00:00.000"

  SpiceOrbit
  {
    Kernel  "Vesta.bsp"
    Target "2000004"
    Origin "10"
    Period  3.63
    BoundingRadius 1e10
  }
     SpiceRotation
    {
      Kernel          [   "pck00010.tpc"  "../../data/naif0012.tls"  ]
      Frame               "IAU_VESTA"
    }
}




whth a spice Vesta.bsp kernel i created from the ftp horizons site


Return to “Modelling”