1.10.4 • Published 2 years ago

potree-loader v1.10.4

Weekly downloads
-
License
BSD-2-CLAUSE
Repository
github
Last release
2 years ago

README

This is a fork of three-loader, which itself is a modularized version of Potree. This fork is updated to support the new PotreeConverter 2.0 format, updated to use WebGL2, and has the bundler changed to Vite. The API is identical to the original version. I am mainly using this for a heritage archive project.

Known issues

  • WebXR not yet supported
  • Warning about THREE being imported twice

Usage

import { Scene } from 'three';
import { PointCloudOctree, Potree } from 'potree-loader';

const scene = new Scene();
// Manages the necessary state for loading/updating one or more point clouds.
const potree = new Potree();
// Show at most 2 million points.
potree.pointBudget = 2_000_000;
// List of point clouds which we loaded and need to update.
const pointClouds: PointCloudOctree[] = [];

potree
  .loadPointCloud(
    // The name of the point cloud which is to be loaded.
    'metadata.json',
    // Given the relative URL of a file, should return a full URL (e.g. signed).
    relativeUrl => `${baseUrl}${relativeUrl}`,
  )
  .then(pco => {
    pointClouds.push(pco);
    scene.add(pco); // Add the loaded point cloud to your ThreeJS scene.

    // The point cloud comes with a material which can be customized directly.
    // Here we just set the size of the points.
    pco.material.size = 1.0;
  });

function update() {
  // This is where most of the potree magic happens. It updates the visiblily of the octree nodes
  // based on the camera frustum and it triggers any loads/unloads which are necessary to keep the
  // number of visible points in check.
  potree.updatePointClouds(pointClouds, camera, renderer);

  // Render your scene as normal
  renderer.clear();
  renderer.render(scene, camera);
}
1.10.4

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.10.1

2 years ago

1.10.0

2 years ago

1.9.97

2 years ago

1.9.96

2 years ago

1.9.95

2 years ago

1.9.94

2 years ago

1.9.93

2 years ago

1.9.92

2 years ago

1.9.91

2 years ago

1.9.9

2 years ago

1.9.8

2 years ago

1.9.7-d

2 years ago

1.9.7-c

2 years ago

1.9.6-b

2 years ago

1.9.6

2 years ago

1.9.5

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.2

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago