Hi all,
quite new to THREE.js (coming from another library)
I played a bit with THREE.LOD and with basic samples everything works as expeced (levels, ranges, etc.) until I tried some imported meshes (glTF) with pivot far outside the mesh itself (this happens a lot with photogrammetric blocks).
After several tries, I figured out it looks like the computation of distance switch (thus the level) is made from local origin and NOT from object3D boundingbox center (as I’d expect). Is that correct?
Is there some way to set some flag to allow the LOD to switch depending on object bb center?
How is this addressed in general? Forcing offsets to my meshes looks a bad idea…
The final LOD translate is needed to restore the block to its original position.
Looks a bit dirty, but it’s working… maybe there are cleaner approaches?
You could patch or extend the LOD class to do this calculation automatically, without actually moving the object (just make sure to only calculate the AABB one time).