stevenlovegrove / Pangolin

Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
MIT License
2.38k stars 853 forks source link

Some obj meshes are loading slowly #521

Open martinruenz opened 5 years ago

martinruenz commented 5 years ago

I noticed that loading (pangolin::LoadGeometry("mesh.obj");) certain meshes in obj format takes a long time. Loading this attached mesh, for instance, lasts for almost 30 seconds on my machine when using a release build of pangolin. There is no delay when opening the same file in meshlab and opening an equivalent ply with pangolin only requires a couple of milliseconds.

I'll have a closer look to see why this happens, when I find the time.

zxy110 commented 3 years ago

Hi,

I've met the same problem, do you solve it? Looking forward to your reply. Thanks!

Best regards

stevenlovegrove commented 3 years ago

I'm not sure about this. On my system that model takes 8s, which is still slow but not that slow...

Looking at the loader, although I use https://github.com/tinyobjloader/tinyobjloader I also do some conversion stuff which looks like a pretty slow loop (https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_geometry/src/geometry_obj.cpp#L143). If you don't need to display textures, I think some of that can be skipped.