Versions
@thatopen/components 3.4.8 (behaviour verified against the published dist/index.mjs). Found while adopting the library as the one rendering seam of a construction-planning app — we deliberately run the camera stack unpatched, so fixes here are inherited directly on the next bump.
What happens
SimpleCamera.setupCamera() constructs the perspective camera as
new THREE.PerspectiveCamera(60, aspect, 1, 1000)
and OrthoPerspectiveCamera.newOrthoCamera() constructs the orthographic camera with near = 0.1, far = 1000.
Nothing in the library ever updates these planes afterwards: updateAspect only touches aspect, and setOrthoPerspCameraAspect only touches left/right/top/bottom. A user can overwrite camera.three.near/far manually, but the values are restored to the hard-coded defaults whenever the cameras are rebuilt.
Why it matters
- Any scene larger than 1 km gets visibly far-plane-clipped. A 600 m long building viewed diagonally with some standoff already exceeds 1000 m — common for infrastructure and site-scale IFC models.
- Geometry closer than 1 m near-plane-clips in perspective mode (interior walkthroughs).
Repro (library only)
- Load a model wider than ~600 m (or any scene of that size).
world.camera = new OBC.OrthoPerspectiveCamera(components); fit the model.
- Orbit: far parts of the model disappear (far = 1000 clipping).
Suggested fix
Make near/far part of the camera config (or derive far from the scene bounding sphere on fit), and preserve user-set values across projection switches. Source home: packages/core/src/core/OrthoPerspectiveCamera/.
Versions
@thatopen/components3.4.8 (behaviour verified against the publisheddist/index.mjs). Found while adopting the library as the one rendering seam of a construction-planning app — we deliberately run the camera stack unpatched, so fixes here are inherited directly on the next bump.What happens
SimpleCamera.setupCamera()constructs the perspective camera asand
OrthoPerspectiveCamera.newOrthoCamera()constructs the orthographic camera withnear = 0.1, far = 1000.Nothing in the library ever updates these planes afterwards:
updateAspectonly touchesaspect, andsetOrthoPerspCameraAspectonly touchesleft/right/top/bottom. A user can overwritecamera.three.near/farmanually, but the values are restored to the hard-coded defaults whenever the cameras are rebuilt.Why it matters
Repro (library only)
world.camera = new OBC.OrthoPerspectiveCamera(components); fit the model.Suggested fix
Make near/far part of the camera config (or derive
farfrom the scene bounding sphere onfit), and preserve user-set values across projection switches. Source home:packages/core/src/core/OrthoPerspectiveCamera/.