Page 1 of 2

Problem with a 3DS model

Posted: 11.09.2008, 17:53
by dams2008
Hello,

I have a problem to display a 3DS model in Celestia.

model.jpg


I create a 3DS model with textures (Freeware Blender) taken from images and I try to visualize the model in Celestia.
I only have a part of the satellite appearing on screen... My model has 3 textures (blue for solar arrays, gold for panels and aluminium for other panels and payload).

I have no problem to visualize 3DS model taken from internet (ex: gb1.3ds).

Is there some recommendation when a 3DS model is generated? All parts of model must be linked? grouped? ...
How do you create your 3DS models? Is there some limitations (number of pieces, size, ...)?

If needed, I can provide you my 3DS model (size 1.6Mb) and my *.ssc file.

Thanks.

Dams.

Re: Problem with a 3DS model

Posted: 11.09.2008, 18:04
by selden
3DS files are limited to 64K points per mesh. There can be more than one mesh in a model file, though.

Many older 3D graphics cards are limited to textures which are at most 1024 pixels on a side. Also, Celestia traditionally has been limited to texture files which are a power of two on a side (128x256, 1024x1024 etc). Celestia v1.5.1 is supposed to be able to resize textures which are not a power of two on a side, but there may be circumstances when it can't.

Re: Problem with a 3DS model

Posted: 11.09.2008, 18:58
by dams2008
Would it be possible that someone tests my 3ds model to know if it is due to an hardware limitation or a problem with the 3ds conversion into celestia?
Do you know some interesting 3D freeware to use?

Dams.

Re: Problem with a 3DS model

Posted: 11.09.2008, 20:21
by BobHegwood
dams2008 wrote:Would it be possible that someone tests my 3ds model to know if it is due to an hardware limitation or a problem with the 3ds conversion into celestia?
Do you know some interesting 3D freeware to use?

Dams.
Sure, e-mail it to me and I'd be happy test it. :wink:
Testing is something I am good at. :D
Check my e-mail address listed on the bottom of my website HERE.

Re: Problem with a 3DS model

Posted: 12.09.2008, 08:40
by dams2008
Thanks for your help Bob.
I have found a solution:
- conversion of 3ds model in cmod model thanks to the tool "3ds2cmodv3-2"
- I noticed some opacity parameters set to 0 instead of 1 in the cmod file (not seen in 3ds software?) => CORRECTED
- I modify some pieces with Blender (seen in solid mode, not in texture mode ... unbelievable??) So I create new parts to replace old ones...
- It works with cmod file...

Now it's great... I have a beautiful model orbiting the earth...
It 's not an optimal way to get a model for celestia but it works.

Have a nice week end.

Dams.

Re: Problem with a 3DS model

Posted: 12.09.2008, 13:32
by Fenerit
dams2008 wrote:Hello,

I have a problem to display a 3DS model in Celestia.

...


I create a 3DS model with textures (Freeware Blender) taken from images and I try to visualize the model in Celestia.
I only have a part of the satellite appearing on screen... My model has 3 textures (blue for solar arrays, gold for panels and aluminium for other panels and payload).

I have no problem to visualize 3DS model taken from internet (ex: gb1.3ds).

Is there some recommendation when a 3DS model is generated? All parts of model must be linked? grouped? ...
How do you create your 3DS models? Is there some limitations (number of pieces, size, ...)?

If needed, I can provide you my 3DS model (size 1.6Mb) and my *.ssc file.

Thanks.

Dams.


Be sure that the textures aren't 32 bit images, or some model's parts will be transparent (that is, you shouldn't see it).

Re: Problem with a 3DS model

Posted: 12.09.2008, 15:37
by BobHegwood
dams2008 wrote:Thanks for your help Bob.
I have found a solution:

Glad to hear it. By the way, I have sent another version of the model to you via e-mail. Read the
text and see the screen shots. It may help with your initial 3ds problems. :wink:

Take care, Bob

Re: Problem with a 3DS model

Posted: 08.12.2008, 14:13
by Stuffer
hey,

I have a problem which looks similar to me as the one discussed here earlier.
I made a 3DS model of a satellite.
On the solarpanels I layed a texture.
But when I want to view it in Celestia the solarpanel texture is all over the satellite, likely because I linked it to the texture in the .ssc-file.
And when I do not link it with the texture through the .ssc-file I can hardly see anything of my satellite, besides some parts which I can't explain.
I think it has something to do with the 3ds model.
I tried to analyze some other 3ds models I can load from the motherlode but I still don't get it.

I hope anyone could help me with this problem.
thanks in advance
Stuffer

Re: Problem with a 3DS model

Posted: 08.12.2008, 15:15
by selden
There are several different problems which can cause a texture not to be applied.
1. the image file must be in the Addon's /textures/medres directory
2. the image must be jpg, png or dds
3. the image must be smaller than the texture limit of the graphics card (1K on a side should be OK)
4. the name of the file must have the same case as is specified in the model
5. the image should be a power of two on a side (this is supposed not to be necessary any more, but some people seem to have had problems related to size)

Re: Problem with a 3DS model

Posted: 09.12.2008, 08:40
by Stuffer
@Selden: Thank you very much for your quick answer.
I checked all the points you mentioned.
to 1: the texture is in the directory celestia/extras/mysatellite/textures/medres. That should be the one you mentioned.
to 2: the image is .jpg
to 3 and 5: the image is only 256x256

Can you clearify what you mean by "same case" which you mentioned in your 4th point?

I think my problem is likely somewhere else:

I have some pictures to illustrate what my problem is.

here's the satellite how it should look like in principle from the 3D program:

Image

and here's what I get in celestia if I insert the option < Texture "solarpanelimage.jpg" > in the .ssc-file:

Image

if I do not insert the option <....> I can't see anything of my model in celestia.

what I'm also not aware of is the following:
when I load the 3ds-model from ISS for example there are many images as textures on the model but they are never related to in the .ssc-file.
Is it enough to link them within the 3ds-file? but then why is my satellite invisible in celestia anyway?

Re: Problem with a 3DS model

Posted: 09.12.2008, 11:37
by cartrite
Stuffer wrote:Can you clearify what you mean by "same case" which you mentioned in your 4th point?
Upper case = "ABCDEFG" Lower case = "abcdefg" File names must use the same case as listed in the model file. So if the model has abc.jpg, then the texture must also be named abc.jpg and not ABC.jpg or abc.JPG.
Also ssc files should not use a texture line. If it does, that will over ride the texture list in the model.
cartrite

Re: Problem with a 3DS model

Posted: 09.12.2008, 11:54
by Stuffer
ok, thanks for clearifying.

the case was not the problem since the .ssc-file did find the image.

Re: Problem with a 3DS model

Posted: 09.12.2008, 12:09
by cartrite
Stuffer wrote:the case was not the problem since the .ssc-file did find the image
Spacecraft models often use many textures. The model is subdivided into sub meshes and each mesh is assigned a texture. If you use textures lines in the ssc file, there is no way to assign each mesh it's texture unless each mesh is a separate model. This is probably where your problem lies. Comment out the texture lines in the ssc file. That way the texture lines in the model will assign the textures.
cartrite

Re: Problem with a 3DS model

Posted: 09.12.2008, 13:12
by Stuffer
hello cartrite,

thank you for your help.

I did comment the texture line out but then I see nothing of my satellite.
What I did afterwards is converting the .3ds-model to a -cmod-model. Here I saw that the opacity and diffuse values are very strange so I set opacity on 1 and diffuse on 1/0. Now I can see my satellite but I don't see my mistake in the .3ds-model. Can I prevent the opacity and diffuse mistake directly in there? I'm using C4D for creating the models or rather to convert them from .vrml to .3ds.

When I change the values I can see the model in celestia but still don't see my textures.

Can you see where I'm wrong?

Re: Problem with a 3DS model

Posted: 09.12.2008, 13:51
by cartrite
When you look at the cmod file, do you see lines something like texture0 "abc.*" or texture0 "abc.jpg"? Are there multiple meshes? Are there texture coordinates?
sample cmod file headers for material and mesh

Code: Select all

material
diffuse 0.8 0.8 0.8
specular 1 1 1
specpower 128
opacity 1
texture0 "yamaguchi03_glow.jpg"
end_material

Here make sure your cmod file has texcoord0 f2

Code: Select all

mesh
vertexdesc
position f3
normal f3
texcoord0 f2
end_vertexdesc

I would need to see the model you are troubleshooting to really see what's going on. Now I'm just guessing.
cartrite

Re: Problem with a 3DS model

Posted: 09.12.2008, 14:56
by Stuffer
Thank you, I really apreciate your help.

I made a simple model consisting only of three bodies. On one of them I layed a texture and saved it as .3ds.
With the 3ds2cmod-software I converted it into cmod (I did none of the fixing options, is that necessary?).

here's what I get in the cmod:

Code: Select all

#celmodel__ascii

material
specular 0.00392157 0.00392157 0.00392157
specpower 128
opacity 4.25804e-011
end_material

material
specular 0.00392157 0.00392157 0.00392157
specpower 128
opacity 4.25804e-011
end_material

material
specular 0.00392157 0.00392157 0.00392157
specpower 128
opacity 4.25804e-011
end_material

mesh
vertexdesc
position f3
normal f3
texcoord0 f2
end_vertexdesc
etc


Then I changed the opacity and specular values as I mentioned before. But there's no diffuse entry and no texture0 entry.
When I tried the real model of my satellite I had a diffuse entry with similar values to the ones here at specular but also no texture0.

Re: Problem with a 3DS model

Posted: 09.12.2008, 15:08
by cartrite
Judging by the materials sections, this model should have 3 meshes. You should add a line in each material section for the texture you want loaded on each mesh. So substitute tex1.*, tex2.*, tex3.* with the actual names of the textures. You can also add a line for diffuse like so. The mesh description you showed does have texture coordinates so they should be alright.

Code: Select all

    #celmodel__ascii

    material
    diffuse 0.8 0.8 0.8
    specular 0.00392157 0.00392157 0.00392157
    specpower 128
    opacity 1
    texture0 "tex1.*"
    end_material

    material
    diffuse 0.8 0.8 0.8
    specular 0.00392157 0.00392157 0.00392157
    specpower 128
    opacity 1
    texture0 "tex2.*"
    end_material

    material
    diffuse 0.8 0.8 0.8
    specular 0.00392157 0.00392157 0.00392157
    specpower 128
    opacity 1
    texture0 "tex3.*"
    end_material

    mesh
    vertexdesc
    position f3
    normal f3
    texcoord0 f2
    end_vertexdesc
    etc

Re: Problem with a 3DS model

Posted: 09.12.2008, 15:25
by Stuffer
thanks for that so far.

Now the textures are at least at the right bodies. So what I'm trying to do next is moving them to the right place on the bodies.

Do I have to do this "Inserting the texture0-option" manually for each body/material I want to have a texture on?
Because regarding for example the ISS that's a big amount of work especially since all materials are called the same in the cmod-file.
And until now I can't foresee how much textures will be on my satellite in the end.

I think there's still a problem with the export option to the 3ds-file because reimporting one the name of the textures are stored but I have to link them again before they are displayed.

Re: Problem with a 3DS model

Posted: 09.12.2008, 15:47
by cartrite
Do I have to do this "Inserting the texture0-option" manually for each body/material I want to have a texture on?
In this case, yes because the texture names were not exported. You may have to trial and error to get the right texture on the right mesh. But what you should do is figure out how to do this in the 3d Program you use. Then export it from the 3d program and the texture names should already be assigned.
cartrite

Re: Problem with a 3DS model

Posted: 09.12.2008, 22:27
by Stuffer
you mentioned the texcoord0 f2.

Can I control where Celestia puts the texture with those values?
If yes, can you tell me how?
Until now the textures are simply wrapped around the mesh in whose material they are referred to by <texture0 "....">. but they should only be on one side.