3d format to load from?

Started by
6 comments, last by griffin2000 17 years, 10 months ago
Ok, writing the .3ds loader was quite entertaining, but now I need something more: for example, .3ds stores only one set of uv maps and only one texture per type (diffuse, specular,..). I thought that the easiest way to do that was writing an exporting plugin (LScript) for the package I use (lightwave) but then I discovered that I don't have access to per vertex normals (calculated taking into account the user defined angle and whether or not angles have to be smoothed). I thought about collada (don't know yet if it would satisfy these conditions) but lightwave doesn't support it. I could write my own loader, but, hey, I don't feel like spending another 2 months just for this. So, what format do you use, and is there some (free) lib I might find interesting?
Advertisement
Writing your own format is typically the easiest way to go. It shouldn't take more than a day or two tops seeing as you are inventing the format along the way.

That said, a lot of people use the old quake formats, md3 i think it's called. You could look around on wotsit.org for other possibilities.

-me
Personally, I prefer using the IGame library (now I3DX or something) to write a custom exporter for 3dsmax. It's really well documented and it's very simle and intuitive to work with.
As for the 2 months of developing time, i'd rather say 2 days or weeks than 2 whole months!
Thank you for the very fast answers!
Quote:
Writing your own format is typically the easiest way to go. It shouldn't take more than a day or two tops seeing as you are inventing the format along the way.

Yep, my own format would be quite easy to do, but in order to do this I need to write a plugin for LW, which doesn't let me access the actual normals of the vertices. I should still compute them somehow. I will take that route eventually, but I was looking for a faster one (if possible).

Quote:Original post by godmodder
Personally, I prefer using the IGame library (now I3DX or something) to write a custom exporter for 3dsmax. It's really well documented and it's very simle and intuitive to work with.
As for the 2 months of developing time, i'd rather say 2 days or weeks than 2 whole months!


I work with OGL and would prefer not to use DX utilities. I have no problems in writing everything from scratch, but I have no more than a couple of hours every day to work on this project, and even the smallest gain in time would thus be wellcome :-)

You could try writing a .dll plugin for LW and add Mesh Mender into it.

If your only problem is the normals, i think there is an .lwo loader in the LW SDK which calculates normals at load time, and which you can use as a reference in case to write your own .lwo loader.

After all, i think .lwo has what you are looking for (multiple images per texture type, multiple uv maps, etc.)

Just some thoughts.

HellRaiZer
HellRaiZer
If you want to write your own, you could start off with the CX mesh format which comes with source and a 3dsmax exporter.

Otherwise, I would suggest using the .X file format, as it's widely supported.
enum Bool { True, False, FileNotFound };
Quote:Original post by HellRaiZer

If your only problem is the normals, i think there is an .lwo loader in the LW SDK which calculates normals at load time, and which you can use as a reference in case to write your own .lwo loader.

HellRaiZer


I will check: if the normals are calculated right (not simply averaging the real polygons normals) then this is definitely something to look into :-)

Quote:
If you want to write your own, you could start off with the CX mesh format which comes with source and a 3dsmax exporter.

Otherwise, I would suggest using the .X file format, as it's widely supported.

Unfortunately I dont't own 3ds max and I highly doubt that LW supports CX (will check though).
As about the .X file format, that could be a possible solution (I *should* be able to find an exporter for it).

Thank to both of you!

EDIT: Ok, I looked at the sample in the SDK: it does the per vertex normal computation as I would have done for 3ds. Ok, then I will write a lscript exporter and use a custom file format. In addition I've found that Java3D provides a interesting LW loader: I could write a conversion tool that uses Java3D and writes my own format.
Thank you again!

[Edited by - cignox1 on June 6, 2006 1:39:12 PM]
IMHO Collada is the way to go. Its open source, supported by all the main 3D packages (including Blender), and being pushed heavily by Sony....

Sorry didn't see your comment about lightwave. Another option would be X3D is that supported for lightwave ?

This topic is closed to new replies.

Advertisement