OpenCTM, mesh compression now in Java

Hi,
some months ago I was searching around the web how one could compress triangle meshes and I found OpenCTM.
After looking at it I think it is quite cool and ported it to Java, so one can use it without native libs.

here some size comparissions:

The way you can store your data is a little bit strict:
1 float3 position
0,1 float3 normal
x float2 texture coordinates with name
x float4 vertex attribute with name
1 material name per mesh
1 file comment

so I thought about altering the format a bit, making it a bit more general. So what do you think?

PS:
I finished it a month ago but thought I would first fix a final bug before releasing it, but because I did not had time until now to do the fix I just release it and do the last fix any time soon. The last bug is that the MG2 compression is not compatible to the original OpenCtm lib but everythung else works I think.

Woah, this is insanely cool. Thanks. :smiley:

OpenCTM is cool, but GPL is a no go for me.

mm the original C lib is under the zlib/libpng license

I just used the GPL at the beginning. I don’t know which license I’m allowed to use or should atm.
I used perhaps some little snippets from the original lib, but the grater structure is from me.

I think I will change the license to some more free one then the GPL, but have to take a closer look first.

GPL taints any project it’s used in. LGPL would be fine.

Hi

Does your port support Collada?

Lol it depends on what you mean by “free”. I assume some people here suggest you to choose a less “restrictive” license but keep in mind that some restrictions are useful to preserve some rights. Personally, I would use the same license than the C version even though I like the GPL.

This is relevant to my interest.

+1.

I didn’t realize that the default license I choose, would start such an offtopic discussion :). I changed it to the LGPL now. I really want others to be able to use the lib in any project they want, but I think it is fair that when someone finds bugs and fixes them for themselves or something else in the lib he should report them back.
Personally I would really like if every game producer would release their code to the public, even if the would do this only after a few months after the game release.

BTW any comments on the file format? The original project is dead I think, so I thought I(we?) could develop it further to be more practicably. My thoughts until now were:
-better support for materials
-animations
-generic vertex attributes
-better viewer to display the differences between quality settings with the lossy compression

Hi, the only thing what I wanted to achieve initially with my port, was to provide a lib to load OpenCTM files in Java. In the end I added the possibility to export too.

The OpenCTM project has already a rich toolset like a converter and viewer of the models. And there is no need to duplicate these too in Java. The official converter tool can read files of the following formats:
OpenCTM (.ctm)
COLLADA 1.4/1.5 (.dae)
Stereolithography (.stl)
Stanford triangle format (.ply)
3D Studio (.3ds)
Wavefront geometry (.obj)
LightWave object (.lwo)
Geomview object (.off)

Needs bone animation!