Skip to content

Upgrading NGL and ThreeJS #892

@MarkH817

Description

@MarkH817

Summary

When upgrading the packages (NGL and Three), some internal behaviors around updating the bounding box for buffers changed and caused previously ignored errors to appear.

  • Versions currently used:
    • NGL v2.0.0-dev.39 (forked)
    • ThreeJS v0.118.0
  • Versions targeted:
    • NGL v2.4.0
    • ThreeJS v0.158.0 (version required by NGL as of v2.3.0)

Update Summary Notes

Changes referenced: https://github.com/MarkH817/EternaJS/compare/90571c7..feature/update-ngl-threejs

  • Successful changes

    • Color representation expanded types, so a utility class was added to maintain compatibility.
    • Lighting default values changed, so previous defaults were added back to maintain visuals.
  • Puzzle 13145824 highlighted an issue with a pair's position info being missing.

    • This doesn't cause an error in the versions in use now but did cause a crash in the updated package.
    • Error message: THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.
    • A fix to ignore the missing data was added in the referenced branch.
  • Viewed puzzle 11212579 for simpler testing

    • When adding/removing a bonded pair in the 3D model, the following error message is printed
    • THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.
    • This doesn't break the renderer at this point, but this occurs when a Cone Buffer or Wide Line Buffer is removed.
      • The error prints 1 time when a Wide Line buffer is removed
      • 2 times when the pair of Cone Buffers are removed
    • When solving the puzzle when clicking the 3D model pairs, the following error is thrown and unhandled.
    • Uncaught TypeError: can't access property "picking", o.userData.buffer is undefined
    • Cannot currently find why ThreeJS throws this only when solving the puzzle this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions