Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / 3DS File format...

Author
Message
Konan
21
Years of Service
User Offline
Joined: 26th Oct 2004
Location:
Posted: 28th Oct 2004 07:14
I just busted out some 3DS code I did a while back and implemented a 3DS exporter (still a little bit rough) for my Blacksmith3D software

[href]www.blacksmith3d.com[/href]

My question is this... the 3DS file format seems to still be widely used in the gaming community (please correct me if I am wrong). There are a few limitations to the format, but the most significant that I can think of right now has to do with texture mapping. In the 3DS file format, texture coordinates have to relate to the vertices in a 1-to-1 kind of way.

In other words, if you have a triangle who's vertex indices go like

Triangle #1, v[0] = 1, v[1] = 10, v[2] = 21

Then the only possible texture coordinates are...

Triangle #1, uv[0] = 1, uv[1] = 10, uv[2] = 21

Many objects have different texture map regions (e.g. front and back). In file formats like OBJ, this is no problem because the UV coordinates are independent of the vertices.

In the 3DS file format, to preserve the texture mapping of such an object, we have to "split" the polygons by creating duplicate vertices. The only problem with this is that it creates a seam in the mesh when we apply a smooth surface (via normals). You can test this out by exporting a 3DS file from 3D Studio Max, and checking the "Preserve MAX texture coordinates" option.

So......

As game creators, have you encountered this problem and how do you go about fixing it? Do you simply use another file format in this situation (*.X)? Do you simply live with the seams? Do you "weld" the seams together after the object is loaded? Or, do you simply avoid rendering the objects with normal smoothing?


I'd appreciate your input regarding this topic,
Konan

Blacksmith3D - Morph and Paint 3D objects with ease
http://www.blacksmith3d.com
JeBuS
21
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Undisclosed Location, Dominion of JeBuS
Posted: 28th Oct 2004 13:17
Most folks around here would tell you they just don't use 3ds. Not for this reason, but because support for 3ds is buggy in DBP. I would say don't worry about 3ds format if it's not working for you. Most folks here aren't looking for something that exports 3ds.


High quality models and graphics, low prices. Graphics for the rest of us.
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 28th Oct 2004 15:22
Quote: "the 3DS file format seems to still be widely used in the gaming community (please correct me if I am wrong). There are a few limitations to the format but the most significant that I can think of "


I'd bet that the most significant limitation of 3DS, in the eyes of the DB programmers, is the inability to store animation. Also, I think DB converts all the 3DS models to .X at load time (at least, in the classic version they did). So 3DS would seem slower to load as well.
Konan
21
Years of Service
User Offline
Joined: 26th Oct 2004
Location:
Posted: 29th Oct 2004 01:43
Great info! I am not too familiar with the X format, so please forgive me if my questions seem trivial....

I did a test export of an X file (using Milkshape), and noticed that it is indeed an ASCII text file. Is this always the case, or is there a binary version of the X file format as well?

Also, I noticed that Milkshape does not have an X importer. Is there a particular reason for this? Is the X format used mainly as an exporter (to then be used in a game), or do people use the X format to save, edit, resave, etc?

Konan

Blacksmith3D - Morph and Paint 3D objects with ease
http://www.blacksmith3d.com
Konan
21
Years of Service
User Offline
Joined: 26th Oct 2004
Location:
Posted: 29th Oct 2004 02:54
Hmmm... for the first release of a "gamer friendly" version of my software, I will not be supporting animation. The workflow would go something like this...

1) Create the basic geometry in your favorite modeller, or use an existing model.

2) Import the model into Blacksmith3D - Suite

3) Morph the shape if you like (e.g. normal man -> muscle man)

4) Paint the textures (true 3D painting)

5) Export the model, animate it if necessary in your favorite editor for animating or "rigging"

6) Import the model into the game.


The software would be especially useful for background objects. For example, if you wanted a boulder for your scene, the workflow would go like this...

1) Import a sphere
2) Morph is to the desired shape (this process would take only a minute or two)
3) Paint the surface (with a nice rock texture, this could only take a minute)
4) Export the model and import it into the game.

Also, if all you wanted to do was paint a texture on the character(skin), then the process would be extremely simple.

1) Import the character
2) Paint the texture(s)
3) Export the texture(s) only
4) Apply the texture to the character in the game (or favorite editor), or simply replace the old texture.

Anyway, that's a general idea as to how the workflow would go for a game maker wishing to use the software.

Konan

Blacksmith3D - Morph and Paint 3D objects with ease
http://www.blacksmith3d.com
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 29th Oct 2004 09:35
Quote: "I did a test export of an X file (using Milkshape), and noticed that it is indeed an ASCII text file. Is this always the case, or is there a binary version of the X file format as well?"


I've seen references to a binary .X format but have not actually seen it in practice. I'm new to modeling though so please take this with a few grains of salt.

Some ASCII .X output I've studied looks to be Unix/Linux-formatted, in that there are newlines (char 10) instead of CR/LF (char 13, char 10) as line delimiters. Modeling software as well as Dark Basic don't seem to give a %!#$ about that, and indeed I've used the Windoze Notepad application to copy and paste portions of these types of files into each other and they still load OK.

Notepad? Yes, that's how desperate I am for a useful animation program. I build animations in Dark Basic Classic, save them to disk, then paste them into the .X model in the appropriate template location.
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 29th Oct 2004 09:45
Quote: "Also, I noticed that Milkshape does not have an X importer. Is there a particular reason for this? Is the X format used mainly as an exporter (to then be used in a game), or do people use the X format to save, edit, resave, etc?
"


Beg forgiveness from the gurus if I get this wrong, but I think that .X is a Microsoft created and/or driven technology that just begs support at some level because so many people have Windows systems with DirectX.

Having been a professional programmer for 20 years, I'm at a total loss why anybody, such as Milkshape, would include an export function for a particular format, but not include an import function. That (il)logic works for some old legacy file format that isn't used much anymore, like a database package that imports dbase III data but doesn't export it. For something as widely used as .X? Beats me...
Konan
21
Years of Service
User Offline
Joined: 26th Oct 2004
Location:
Posted: 30th Oct 2004 02:20
Hmmmm... Good information!

Since the X format is a text based one, it makes things super easy for me. When it comes to exporting the object, I can do the same thing that I do for the CR2 files....

To preserve all of the animation and other information that Blacksmith3D does not use, I can simply "inject" the new geometry back into the X file. That is, I make an exact copy of the original X file, but when it comes to the geometry (or texture map) parts, I replace the old stuff with the new stuff.

Konan

Blacksmith3D - Morph and Paint 3D objects with ease
http://www.blacksmith3d.com
Clueless
22
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 31st Oct 2004 05:48
Quote: "I can simply "inject" the new geometry back into the X file."


Sounds very possible, at least in theory. I've done that very thing using Notepad. You'll most likely run into trouble if you change the geometry or structure of the model though. I managed to get some very interesting error messages when hacking around with this, but in every case it was just my noobiness rearing its ugly head -- I was trying to animate a deleted limb, "injecting" the animation data into the wrong place in the .x template etc.

So far, I've been able to pull it off as long as I keep a working READ-ONLY copy of the .X file to use as a guide for my cutting and pasting. Microsoft has a ton (too much!) info on the .X file format in their MSDN section. I haven't been desperate enough to read it yet, but I'm sure it'd provide good info if you had time.
Gen
22
Years of Service
User Offline
Joined: 6th Jul 2004
Location: Oklahoma, USA
Posted: 1st Nov 2004 13:27
Quote: "I did a test export of an X file (using Milkshape), and noticed that it is indeed an ASCII text file. Is this always the case, or is there a binary version of the X file format as well?"


Yes there is a binary and text format for the X file format.
Ianhfar
22
Years of Service
User Offline
Joined: 8th Jul 2004
Location: UK
Posted: 1st Nov 2004 17:28
Konan

There are three .x formats with Directx 9.0c,
Ascii,Binary and Compressed Binary. You should scan msdn for more information on the formats

Ianhfar
Jake Blues
22
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 4th Dec 2004 09:04
Both .x and .3DS can use ascii.
In truespace, you can export a model into a 3ds ascii format, which in notepad, has all the vertices and colors and stuff all listed out.

It's all legable too.

Don't let life get you down, it will only get better.

Login to post a reply

Server time is: 2026-07-11 08:46:28
Your offset time is: 2026-07-11 08:46:28