Repository navigation
Description
Describe the bug 📝
go() sets the projection, the position and the target only. A viewpoint with a 35.98° field of view (as in buildingSMART's BCF 3.0 test cases) is shown at 60°, and an orthographic one at whatever zoom the camera had. Saving an orthographic view is off too: updateCamera() stores view_to_world_scale: top − bottom, but the orthographic camera zooms through camera.zoom, so at zoom 2 the stored visible height is twice the real one.
buildingSMART's "all components and spaces visible" test case (35.98°). Left: as in its snapshot. Right: BCFTopics.load + go(), at 60°.
Expected: go() sets threePersp.fov (and calls updateProjectionMatrix()), or zooms the orthographic camera to (top − bottom) / view_to_world_scale; updateCamera() stores (top − bottom) / zoom, as That Open's own projection switch already divides by the zoom.
Also found by reading the code (not in the repro): go() calls camera.projection.set(this.projection) without await. Switching to perspective is async (it ends with controls.zoomTo(1)), so it can finish after setLookAt.
Where in the code
go(): viewpoint.ts#L353-L428; the projection switch withoutawait: #L377updateCamera(): #L478- The projection switch dividing by the zoom: OrthoPerspectiveCamera/src/projections.ts#L151-L154
Reproduction ▶️
Steps to reproduce 🔢
- In the repro:
npm install,npm run dev, openissue-4/example.html. Both worlds load buildingSMART'sArchitectural.ifc. - Perspective: field of view 35.98° restores the "all components and spaces visible" test case, on the left as BCF means it and on the right with
BCFTopics.load+go(). - Orthographic: 18.97 m high does the same with the "Component selection" test case. Then the right view is zoomed by hand to the file's height and captured with
updateCamera(). - The panel's Results:
BUG go() field of view: got 60, expected 35.983
BUG go() orthographic visible height: got 92.376, expected 18.974
BUG updateCamera() view_to_world_scale: got 92.376, expected 18.974
System Info 💻
System:
OS: Windows 11 10.0.26200
CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
Memory: 33.34 GB / 63.76 GB
Binaries:
Node: 22.22.1 - C:\nvm4w\nodejs\node.EXE
npm: 11.12.0 - C:\nvm4w\nodejs\npm.CMD
Browsers:
Chrome: 156.0.8078.48
Edge: Chromium (152.0.4191.53)
npmPackages:
@thatopen/components: 3.6.0 => 3.6.0
@thatopen/components-front: 3.6.0 => 3.6.0
@thatopen/fragments: 3.6.0 => 3.6.0
@thatopen/ui: 3.4.17 => 3.4.17
camera-controls: 3.1.2 => 3.1.2
three: 0.184.0 => 0.184.0
web-ifc: 0.0.77 => 0.0.77Used Package Manager 📦
npm
Error Trace/Logs 📃
No response
Validations ✅
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
- Check that this is a concrete bug. For Q&A join our Community.
- The provided reproduction is a minimal reproducible example of the bug.

Activity