1.10.4 • Published 2 years ago
potree-loader v1.10.4
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
3 years ago
1.9.96
3 years ago
1.9.95
3 years ago
1.9.94
3 years ago
1.9.93
3 years ago
1.9.92
3 years ago
1.9.91
3 years ago
1.9.9
3 years ago
1.9.8
3 years ago
1.9.7-d
3 years ago
1.9.7-c
3 years ago
1.9.6-b
3 years ago
1.9.6
3 years ago
1.9.5
3 years ago
1.9.4
3 years ago
1.9.3
3 years ago
1.9.2
3 years ago
1.9.1
3 years ago
1.9.0
3 years ago