2

I would like to render bare earth LiDAR data with a colour ramp using natural colors instead of vibrant blues to yellow to red.

Does anyone know how to manipulate Potree to enable this?

2

Look for "potree.Gradient" in the file potree.js

The Gradient is a collection of six colourvalues. Each value is the RGB Value divided by 255.

Potree.Gradients = {
    RAINBOW: [
        [0, new THREE.Color(0.278, 0, 0.714)],
        [1/6, new THREE.Color(0, 0, 1)],
        [2/6, new THREE.Color(0, 1, 1)],
        [3/6, new THREE.Color(0, 1, 0)],
        [4/6, new THREE.Color(1, 1, 0)],
        [5/6, new THREE.Color(1, 0.64, 0)],
        [1, new THREE.Color(1, 0, 0)]
    ],
    ...

Write new colours in, delete cache and enjoy the scene

  • To add to this, you can actually define any number of gradient stops you want and you can change it at runtime using: viewer.scene.pointclouds[0].material.gradient = [ [0.1, new THREE.Color(1.0, 0.0, 0.0)], [0.9, new THREE.Color(0.0, 0.0, 1.0)] ] – Markus Feb 27 '17 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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