Skip to content

Viewpoint: the camera up vector is wrong on capture, BCF-XML export and import, and go() ignores it #861

Open

Description

@BiroBotond0

Describe the bug 📝

BCF's camera_up_vector / CameraUpVector is the up direction of the image, orthogonal to the camera direction. That Open never has a valid one, so a plan view imported from another tool is shown turned, and a plan view exported from That Open is read by others with an up vector parallel to the view direction.

Image

buildingSMART's "Orthogonal camera" test case, a plan view with IFC −X up. Left: as in its snapshot. Right: BCFTopics.load + go(), turned by 90°. Then both cameras from outside: same place, different up arrows.

  • updateCamera() always stores (0, 1, 0). For a plan view that is parallel to the direction.
  • serialize() derives it by rotating the direction 90° around X. For a horizontal view along X that is the direction itself.
  • BCFTopics.load sets it to (0, 0, 0).
  • go() does not use it.

Expected: updateCamera() and serialize() write the camera's actual up (new Vector3(0, 1, 0).applyQuaternion(camera.getWorldQuaternion(q))), load keeps the file's CameraUpVector, and go() applies it.

Where in the code

Reproduction ▶️

https://github.com/BiroBotond0/thatopen-bcf-bug-reproduction/tree/main/issue-3

Steps to reproduce 🔢

  1. In the repro: npm install, npm run dev, open issue-3/example.html. Both worlds load buildingSMART's Architectural.ifc.
  2. The "Orthogonal camera" test case is restored on the left as BCF means it, and on the right with BCFTopics.load + go(). (The orthographic size is set by hand after go(), see Viewpoint: go() applies neither field_of_view nor view_to_world_scale, and updateCamera() stores the orthographic height without the zoom #850 .)
  3. Overview of both cameras draws both cameras: in the same place, looking down, with different up arrows.
  4. The panel's Results (the imported up, a capture of the plan view, and serialize() of a horizontal view along X):
BUG BCFTopics.load camera_up_vector length: got 0, expected 1
BUG updateCamera() up · direction (plan view): got -1, expected 0
BUG serialize() up · direction (horizontal view): got 1, expected 0

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.77

Used 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions