• Forum
  • Lounge
  • Extraordinarily simple static 3D model f

 
Extraordinarily simple static 3D model format

So the time has come...

As some of you might know, I've started writing a little FPS game using opengl that's going to be a little bit like DOOM95. (Will edit with some images later on.) I just finished porting my terrain work from using the fixed pipeline to using IBOs, and now I'm ready to start placing some models on the maps. So that leads me to the problem: The Models.

I've done some Googling only to find very strong and mixed opinions on what model formats to use. It seems like 50% say to use an existing format (3DS being the biggest recommendation), while the other 50% say to make a new format that fits your game. I took a look at the 3DS format and it looks a bit complex to be parsing myself (and bloated due to the limited features that I'll actually be using). GPL'ed loading libraries are out of the question as well on account of my viral license boycott.

I drafted up a very simple custom format that I'm considering:


#assumed to be little-endian
[Header]
	Magic Number (16-bit)
	Version Number (16-bit)
[/Header]

[Data Tables]
	[Normals]
		Normal Count (16-bit)
		for(N = 0 to Normal Count)
		{
			X (32-bit)
			Y (32-bit)
			Z (32-bit)
		}
	[/Normals]
	[Vertices]
		Vertex Count (16-bit)
		for(N = 0 to Vertex Count)
		{
			X (32-bit)
			Y (32-bit)
			Z (32-bit)
		}
	[/Vertices]
	[Colors]
		Color Count (16-bit)
		for(N = 0 to Color Count)
		{
			R (8-bit)
			G (8-bit)
			B (8-bit)
		}
	[/Colors]
[/Data Tables]

[Indices]
	while not eof
	{
		Normal Index (16-bit)
		for(N = 0 to 3)
		{
			Vertex Index (16-bit)
			Color Index (16-bit)
		}
	}
[/Indices]


To start things off simple, I was only going to use color blending in my models rather than texture operations, as I'm fairly new to 3D and do not have the artistic ability to make quality textures. My main question is: Is there already a bloat-free format out there similar to this that I might be able to convert from? I'd also appreciate any other input that might help.

Thanks.
I don't have much experience with model formats, but I still don't understand why you don't just use the ASSIMP library. The file format "bloat" is minimal for features you don't, and you don't even have to handle these features if you do end up using them.

But, if you're still hell-bent on using your own format, OBJ is probably the simplest.
Last edited on
Looks like quite a nice library...I hadn't found this in my Googling. Thanks NGen.

*And beautiful documentation! That's rare!
Last edited on
Looks a bit like Milkshape3d format. (The editor is payware, just in case you wanted to know.)
I've got several modelers. Milkshape 3D, Blender, and Wings 3D on all my computers. Sadly I've not bothered looking into their formats before.
Topic archived. No new replies allowed.