0.9.2 • Published 3 years ago

ts-basic-gltf-viewer v0.9.2

Weekly downloads
47
License
MIT
Repository
github
Last release
3 years ago

ts-basic-gltf-viewer

three.js-based basic gltf model viewer

Features:

  • multiple gltf/glb (with optional draco compression) models support
  • view only (model editing is out of this package's scope)
  • renderer with auto canvas resize and transparent background (so outer container background used, easy to switch colors)
  • optional performance optimization by merging all scene meshes into single mesh (or one mesh per loaded model optionally) with vertex colors (alpha supported) to reduce frame time by minimizing render calls
  • optional render speed optimization while moving/rotating camera by using simplified background scene
  • assigning different colors to groups of model meshes
  • selection of model meshes from code by mesh ids (a combination of internal model UUID and mesh 'name' field used as id) with auto centering camera on selection
  • mouse and touch support (pointer events used): OrbitControls navigation; single (tap/click) and multiple (ctrl + click) manual selection of model meshes (fast GPU picking used); isolation of selected meshes (double-tap/click); highlighting model meshes on hover; area selection
  • notification of changes in opened models and mesh selection using rxjs subjects
  • options change at runtime
  • custom axes helper with camera rotation on axis label click
  • HUD scene for showing custom 2d infographics on top of model view
  • distance measure with vertex snap using raycaster and barycentric coordinates

Created for personal use in a specific project, so use cases may be limited and not much description provided, but maybe some parts of the code will still be helpful to someone. The main goal was to make it possible to open dozens of large industrial building models with thousands of elements and millions of polygons while keeping an optimal render performance. Optimized mesh merging to reduce render calls, GPU picking, using only vertex colors, etc. were the ways to achieve it. Target models were static without the need to take into account their internal structure, all meshes used indexed BufferGeometry and MeshStandardMaterial without textures.

If I find time for this, or if there are any requests, I will complete the description.

dependencies:

  • three.js
  • RxJS
0.9.0

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.8.12

3 years ago

0.8.11

3 years ago

0.8.10

3 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.2

3 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago