OpenCTM
OpenCTM copied to clipboard
Raw to MG2 does not work for some cases.
Not sure if there is a body to look at this...
I export a mesh in Raw ctm file, and it looks well in OpenCTM desktop viewer, but it messed up in desktop viewer when I extract the mesh from Raw ctm file and encode to the MG2 ctm file.
Here are the raw and raw2mg2 images
Here is the code snippet to reproduce this issue. FileStream fileStream = new FileStream(@".\TestData\raw.ctm", FileMode.Open); OpenCTM.CtmFileReader reader = new OpenCTM.CtmFileReader(fileStream);
Mesh mesh = reader.decode();
FileStream newfs = new FileStream(@".\TestData\raw2gm2.ctm", FileMode.OpenOrCreate);
CtmFileWriter fw = new CtmFileWriter(newfs, new MG2Encoder());
fw.encode(mesh, "reproduce error.");
newfs.Close();
I uploaded the raw.ctm file here, and please rename it to raw.ctm.
Only on my tablet atm, but did you check the mg2 settings? If your model has a very small scale the default settings might not work, mg2 is a loss-full encoding which let you specify an allowed error.