0

I am using the latest version of Potree (the version last updated 27/08/2018). I have converted my source LAZ data into Potree compatible LAZ tiles (using PotreeConverter.exe). I have huge amounts of data (by this I mean possibly a few TBs worth of LAZ data). This is for the road network of the country I reside in.

How do I programatically zoom to a given set of coordinates (XYZ) in the point cloud upon initial load?

My point cloud is potentially hundreds of miles wide, therefore I need to zoom to given coordinates e.g. XYZ coordinates 409200.000, 209200.000, 150.000.

I have tried the following. It zooms, not to the desired location/coordinates:

Potree.loadPointCloud("pointclouds/OsgbColour/cloud.js", "OsgbColour", e => {
        let pointcloud = e.pointcloud;
        let material = pointcloud.material;
        viewer.scene.addPointCloud(pointcloud);
        material.pointColorType = Potree.PointColorType.RGB; // any Potree.PointColorType.XXXX 
        material.size = 1;
        material.pointSizeType = Potree.PointSizeType.ATTENUATED;
        material.shape = Potree.PointShape.CIRCLE;
        viewer.fitToScreen();

        viewer.scene.view.position.set(409200.000, 290200.000, 150.000);
        viewer.scene.view.lookAt(4092000.000, 290200.000, 150.000);
        var myactivecamera = viewer.scene.getActiveCamera();
        myactivecamera.position.set(4092000.000, 290200.000, 150.000);
        myactivecamera.zoom += 3.0;
    });

1 Answer 1

2

I have managed to sort it, as follows (the last 2 lines):

Potree.loadPointCloud("pointclouds/OsgbColour/cloud.js", "OsgbColour", e => {
    let pointcloud = e.pointcloud;
    let material = pointcloud.material;
    viewer.scene.addPointCloud(pointcloud);
    material.pointColorType = Potree.PointColorType.RGB; // any Potree.PointColorType.XXXX
    material.size = 1;
    material.pointSizeType = Potree.PointSizeType.ATTENUATED;
    material.shape = Potree.PointShape.CIRCLE;

    viewer.scene.view.position.set(409600.000, 290000.000, 400.000);
    viewer.scene.view.lookAt(new THREE.Vector3(409200.000, 290400.000, 75.000));
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.