Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: energy on February 10, 2011

Title: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: energy on February 10, 2011
Hi!
Did anyone played with that lib arround?
OpenCTM — the Open Compressed Triangle Mesh file
http://openctm.sourceforge.net/

It compresses the Wavefront Obj-files in a very good size.
My prob is that im not a C++ coder.
Is there anybody out here,who can strip the Unpack routine
in a single tiny static lib, without all other unneeded functions
??

Thanx in advance...
eNeRGy
Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: va!n on February 10, 2011
i think it would be interested for the guy, who create a decompress lib only, what kind of compression you are used? MG1, MG2, RAW... Seems the packer is based on LZMA...

Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: energy on February 10, 2011
Hi va!n !
Nice to hear yu again!
MG2 Compression is used. Model was packed with the OPENCMT viewer. Compressed from 139K to 6K.
Decompressor should be tiny small for use with 64K Intros.So there could be only MG2 decompression in....
Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: hellfire on February 10, 2011
If you're heading for 64k it's not a good idea to use compressed data in your binary:
- You'll use some exe-packer anyway and you don't want to spend precious bytes on a second decompressor.
- The exe-packer will be having a hard time trying to pack already-compressed data.

So you better apply only the prediction sheme to reduce entropy and let the packer care about the rest.
Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: energy on February 10, 2011
OK.
Which way would yu go to export tiny modeldata from eg. Blender...
What could be a good way to reduce the size of the data?
Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: va!n on February 10, 2011
Hi energy! I think the best way to get a good packrate is to cut down the data but withput packing... In this case probaly the best way is to use the converted dataformat in a uncompressed way (also the MG2 format but not packed... just as raw, so the exepacker can work on this to reach the best packing rate.
Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: hellfire on February 10, 2011
What could be a good way to reduce the size of the data?
Here is a simple prediction-scheme for vertex-positions:
(http://www.abload.de/img/vertex-prediction5efj.png)
Assume you're starting with an initial triangle (v1,v2,v3).
Find a neighbouring triangle which shares an edge with the current triangle.
Now find the centroid of the shared edge and project the unshared vertex (in this case v1) over to the other side.
Instead of storing v4 you just store the delta from the predicted position to the actual vertex.
As these deltas will cover a much smaller range than absolute positions, you can easily quantize them to just a few bits.
Title: Re: OpenCTM — the Open Compressed Triangle Mesh file format Unpack routine
Post by: energy on February 10, 2011
thanx hellfire.
will have a closer look on it!