Hi to you all!
I'd like to draw your attention to a fact concerning the use of model files (3ds) in Celestia.
Please pay attention and be very careful when you modify "3ds" files with Hexadecimal editors or other similar tools, whenever you want to change the name of texture files: as far as I can see, it happens that these tools don't correct all the relevant records in the file.
The worst thing happens when you "add" bytes to the file (for example when you want to "correct" a shorter name with a longer one): in such a case the file becomes thoroughly corrupted.
I have started examining 3ds files with a hexadecimal reader and a good knowledge of the files: "3ds" files are record based files, each record made of these fields:
- a marker (a specific 16 bit pattern that describes the record)
- the length of the record itself (a long value, 32 bits) (marker+length+data)
- the record data
I found that many Celestia "3ds" files cannot be opened with Anim8or : so I started reading them with a Visual Basic parser (found in internet) and I always found that the culprit is one of the fields that is corrupted.
Perhaps Celestia doesn't complain about these strange records : I do wonder how it can show a model correctly, when neither anim8or nor the VB parser succeed in this task
As an example I read the file "graticule-blue.3ds" from Selden add-on (I have not yet tried it in Celestia...) : the parser bails out after reading the name of the texture ("graticule-blue.*") at the offset 0x170 of the file.
This file can't be read because its length (0x1722 bytes) is wrong as compared with the length in the first record : at offset 0x2 you can read 0x171E, perhaps the original length of the file. (in this case we have : marker=0x4d4d, len=0x171e, data= the file itself!)
The worst thing is now that the string ("graticule-blue.*") is inside a record (starting at offset 0x16A, with the marker=0xA300), whose length is 0x13.
In such a record the string is practically truncated to a otherwise useless "graticule-blu" without any extension at all!
With this in mind, I can suppose that Celestia simply "searches" all the wanted records (a lot of them!), without worrying about "previous" or "following" records or record lengths, without parsing the file... and without bailing out!
This behavior is obviously correct: the important is that you can see the object in Celestia.
BTW I don't know if 3DStudio (or other 3D program) can import those files...
I will further investigate other situations in which also Celestia has a strange behavior showing objects: I'll be clearer if you are interested in this matter.
Good bye
Pierluigi
Add-ons and 3ds model files
You are right,I cannot open these files in 3DS Max.I havent tried the one you were on about I'll try now but when I tried to open Billboard files from Seldens site it said something like 'unknown file format' or something like this-even though it was a 3DS File.I'll try with the file you mention and see what happens,cheers Jestr
PierLuigi,
As I've mentioned often, I use Emacs to modify the filename within 3DS files. I only care that the resulting model file is readable by Celestia.
It's usually inappropriate to edit one of those files in a 3D modelling tool, anyhow, since they aren't the originals. In most cases, the original file specification format is 8.3, so I expect that using Emacs to restore the filespec to that size (8 characters in the name, 3 in the filetype, separated by a dot) would make such a file readable again by 3D modelling programs.
The models that I create are in AN8 format, which Celestia can't use. I'll consider including a copy of the .AN8 file in future Addons or when I update older ones.
It'd be nice if Celestia directly supported .AN8 format, since it's a plain-text file and provides many features that Chris has mentioned would be desirable.
As I've mentioned often, I use Emacs to modify the filename within 3DS files. I only care that the resulting model file is readable by Celestia.
It's usually inappropriate to edit one of those files in a 3D modelling tool, anyhow, since they aren't the originals. In most cases, the original file specification format is 8.3, so I expect that using Emacs to restore the filespec to that size (8 characters in the name, 3 in the filetype, separated by a dot) would make such a file readable again by 3D modelling programs.
The models that I create are in AN8 format, which Celestia can't use. I'll consider including a copy of the .AN8 file in future Addons or when I update older ones.
It'd be nice if Celestia directly supported .AN8 format, since it's a plain-text file and provides many features that Chris has mentioned would be desirable.
Selden
-
Topic authorpiellepi
- Posts: 124
- Joined: 25.09.2003
- Age: 69
- With us: 21 years 2 months
- Location: Rome, Italy
Hi,
today, at office, I was searching a free 3ds file reader and I found an interesting site about Delphi programming (http://www.delphi-gems.com/3ds.php).
If you are interested in the matter, here you can find a program (opener.exe) by which you can open 3ds file and look at their secrets.
The "graticule-blue.3ds" file can be read without problems, but instead there are problems with some of the files comprised in some add-ons by MindToAsk (in particular "M65.3ds" shows a bad format).
Selden, I don't know Emacs (instead I could suggest you "Hex Workshop") and I didn't understand what you said about 8.3 file name convention: I am a very old-but-skilled programmer (I started in the ancient "DOS 3.1 + ASM" epoch!! ) and AFAIK the name "graticule-blue.3ds" does NOT follow the old and infamous 8.3 convention.
I'll continue my investigations.
Pierluigi
PS: IMHO Celestia is the GREATEST program I have ever used and I find it VERY useful in my hobby !!
I am an amateur astronomer: I started studying astronomy just the night (for Italy...) Louis Armstrong first set foot upon the moon, in 1969!
today, at office, I was searching a free 3ds file reader and I found an interesting site about Delphi programming (http://www.delphi-gems.com/3ds.php).
If you are interested in the matter, here you can find a program (opener.exe) by which you can open 3ds file and look at their secrets.
The "graticule-blue.3ds" file can be read without problems, but instead there are problems with some of the files comprised in some add-ons by MindToAsk (in particular "M65.3ds" shows a bad format).
Selden, I don't know Emacs (instead I could suggest you "Hex Workshop") and I didn't understand what you said about 8.3 file name convention: I am a very old-but-skilled programmer (I started in the ancient "DOS 3.1 + ASM" epoch!! ) and AFAIK the name "graticule-blue.3ds" does NOT follow the old and infamous 8.3 convention.
I'll continue my investigations.
Pierluigi
PS: IMHO Celestia is the GREATEST program I have ever used and I find it VERY useful in my hobby !!
I am an amateur astronomer: I started studying astronomy just the night (for Italy...) Louis Armstrong first set foot upon the moon, in 1969!
Pierluigi,
If you want to "fix" one of the 3DS graticule files that I created, you need to edit them using a binary-friendly editor (like Emacs) and change the length of the name so that it has a total length of 12 characters. The original filename was "12345678.jpg" which is 8.3.
"graticule-blue.*" is 14.1 -- 16 characters long. If you change the name to "gratblue.jpg" the file probably will be readable by a 3D modelling program.
Ensuring that my *very* simple models are editible by 3D modelling programs is not one of my goals. Having filenames that are understandable by people and by Celestia is.
The graticules are only three objects: two squares and a sphere.
If you want to "fix" one of the 3DS graticule files that I created, you need to edit them using a binary-friendly editor (like Emacs) and change the length of the name so that it has a total length of 12 characters. The original filename was "12345678.jpg" which is 8.3.
"graticule-blue.*" is 14.1 -- 16 characters long. If you change the name to "gratblue.jpg" the file probably will be readable by a 3D modelling program.
Ensuring that my *very* simple models are editible by 3D modelling programs is not one of my goals. Having filenames that are understandable by people and by Celestia is.
The graticules are only three objects: two squares and a sphere.
Selden
bh,
This filename length problem is due to the way I edit the 3DS model files to change the texture image file name after Anim8or has exported the 3DS files. I suspect most models won't have this particular problem. Since the models have to be edited to specify Celestia's wildcard filetype, and that's not compatible with Anim8or either, I simply can't get excited about the fact that the different length causes problems, too.
I've heard rumors that Anim8or does choke on some other 3DS models (models not intended for Celestia), but I don't know the details.
This filename length problem is due to the way I edit the 3DS model files to change the texture image file name after Anim8or has exported the 3DS files. I suspect most models won't have this particular problem. Since the models have to be edited to specify Celestia's wildcard filetype, and that's not compatible with Anim8or either, I simply can't get excited about the fact that the different length causes problems, too.
I've heard rumors that Anim8or does choke on some other 3DS models (models not intended for Celestia), but I don't know the details.
Selden