How to write an .mlp file (meshlab project) in C++? -
i'm trying open .mlp project meshlab created/ written out of c++ program (all files e.g. mesh, texture , .mlp in same folder).
i'm writing .mlp project in following way:
wofstream myfile; if (myfile.is_open()) { myfile << l"<!doctype meshlabdocument>\n<meshlabproject>\n <meshgroup>\n"; //[...] myfile.close(); } the problem is: final file can't opened meshlab or opened not correctly: shows mesh loaded there no mesh/ mesh 0 vertices.
to check mistakes, created sample project in meshlab , compared resulting .mlp file in c++ created .mlp file: booth identical (only values of rotation/ translation matrices different).
the file size differs byte (between 10 , 18), added bit of code (found here) encoding utf8:
myfile.imbue(std::locale(std::locale::empty(), new std::codecvt_utf8<wchar_t, 0x10ffff, std::generate_header>)); unfortunately didn't fix problem , meshlab still unable read project...
if has tips or solution problem, grateful!
in addition: not-working .mlp looks this:
<!doctype meshlabdocument> <meshlabproject> <meshgroup> <mlmesh filename="meshedreconstruction1.ply" label="meshedreconstruction1.ply"> <mlmatrix44> 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 </mlmatrix44> </mlmesh> </meshgroup> <rastergroup> <mlraster label="examplepic1.png"> <vcgcamera rotationmatrix="0.999985 -0.005109 0.002027 0.000000 0.005126 0.999953 -0.008233 0.000000 -0.001985 0.008243 0.999964 0.000000 0 0 0 1" centerpx="960 540" viewportpx="1920 1080" translationvector="0.005810 -0.001382 -0.001205 1.000000" focalmm="36.653561" lensdistortion="0 0" pixelsizemm="0.0319256 0.0319256" cameratype="0"/> <plane semantic="1" filename="examplepic1.png"/> </mlraster> </rastergroup> </meshlabproject> working .mlp looks this:
<!doctype meshlabdocument> <meshlabproject> <meshgroup> <mlmesh filename="meshedreconstruction1.ply" label="meshedreconstruction1.ply"> <mlmatrix44> 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 </mlmatrix44> </mlmesh> </meshgroup> <rastergroup> <mlraster label="examplepic1.png"> <vcgcamera rotationmatrix="0.999683 0.0245459 0.00566618 0 -0.0245495 0.999699 0.000560548 0 -0.00565071 -0.000699472 0.999984 0 0 0 0 1 " centerpx="960 540" viewportpx="1920 1080" translationvector="-0.0273756 0.00583069 -0.398988 1" focalmm="46.0408" lensdistortion="0 0" pixelsizemm="0.0317889 0.0317889" cameratype="0"/> <plane semantic="1" filename="examplepic1.png"/> </mlraster> </rastergroup> </meshlabproject>
Comments
Post a Comment