.x3d format

Bah I know I’m posting a crazy amount of topics these days, so please bear with me.
My idea is, instead of using super complex loader that might and might not work, let’s create our specific format that could be used for a variety of things such as perpixel lighting, multi-texturing etc…
Here’s my idea

Header: xith3d = file header
Meshes: 2 = number of meshes
Mesh1: numberOfElements numberOfIndices numberoftextures
tex1Type 3 or 2

4bytes4bytes4bytes vertex components
4bytes4bytes4bytes normal components
4bytes4bytes4bytes tangent components
4bytes4bytes4bytes binromal components
4bytes4bytes(4bytes) texture 1 components

I already wrote a little parser for this format and it’s an extremely easy task, I also wrote an exporter 3ds -> .jcd (this format)
Thoughts?

For me, binary format is useful if it can be directly used from disk, without explicit loading/converting into memory(except header of course). This probably means that all major blocks should be aligned to some number of bytes (32?). It might be also useful to align vertex size to some multiple of 8,16 or 32 bytes, depending on GPU. Indices should be specified in order friendly for cache. It would be nice to have support for mixed geometry types (same vertex data, with multiple strips/free triangles).

In general, when I think about such formats, I imagine distributing models in some other format (modeller one for example) and creating binary, ready to use directly from disk format on install time. Same goes for textures, althrough dds is already designed this way.

this would be cool- but 3ds wont export multi-texturing or bumpmapping etc etc anyway. so maybe we need a little editor to go with it :slight_smile: make the model in 3ds- then open JCD texture .x3d editor to add all the other stuff- even shaders :slight_smile: … now that would rock!

when done save as .x3d and bosh - load your .x3d file into your own project using the cool x3dLoader.jar

bish bosh- that would be sweet… but yes- a little to much hard work maybe?

just an aside - be cautious using the term “x3d” as that refers to the X3D specification by the World Wide Web Consortium - the XML descendant of VRML (i’m sure you’ve heard of it - http://web3d.org/).

maybe .xith is a better extension :slight_smile:

Will.