GithubHelp home page GithubHelp logo

Problem with color about potree HOT 10 CLOSED

potree avatar potree commented on June 1, 2024
Problem with color

from potree.

Comments (10)

m-schuetz avatar m-schuetz commented on June 1, 2024

That's because your largest intensity value is 2194 but with the -r parameter, you're telling the converter that the intensity goes up to 65536. The converter then calculates the rgb color in a [0,255] intervall as 255*(2194/65536) = 8, which is pretty much black.

Try it again with -r 2194.
Points with intensity 2194 should be white with this setting. A larger value for -r will darken the point cloud.

Send me a mail when you've put something online!

from potree.

Phatnine avatar Phatnine commented on June 1, 2024

Ok thanks for your answer. Now, I can see white to dark points. Is it
possible to have pseudocolor based on intensity?

Also, there seems to be a problem with my pointcloud. It seems to be in the
wrong axis.
[image: Images intégrées 3]
I modified example distance_measure and added my dataset. The grid is
located at the 2.43. I probably need to rotate my dataset, but I do not
know where to do it. Also, I suppose it's linked to this problem, but the
mouse control is messed up. When I rotate to the left, it rotates to the
right, etc. Also, I cannot zoom in up to a certain level.

My dataset comes from a Lidar surveying of a road and bridge section, so it
is georeferenced in X/Y/Z.

Thank you,
Maxime

2014-07-15 16:16 GMT-04:00 Markus Schütz [email protected]:

That's because your largest intensity value is 2194 but with the -r
parameter, you're telling the converter that the intensity goes up to
65536. The converter then calculates the rgb color in a [0,255] intervall
as 255*(2194/65536) = 8, which is pretty much black.

Try it again with -r 2194.
Points with intensity 2194 should be white with this setting. A larger
value for -r will darken the point cloud.

Send me a mail when you've put something online!


Reply to this email directly or view it on GitHub
#45 (comment).

from potree.

Phatnine avatar Phatnine commented on June 1, 2024

image

from potree.

m-schuetz avatar m-schuetz commented on June 1, 2024

The rotation issue is very common. That's because a lot of software uses z as the up axis while opengl and threejs, and therefore potree as well, use y as the up axis.

You can flip z and y with this matrix transformation:

pointcloud.applyMatrix(new THREE.Matrix4().set(
    1,0,0,0,
    0,0,1,0,
    0,1,0,0,
    0,0,0,1
));

And if it's upside down afterwards, simply replace 1 with -1 in the third row.

Ok thanks for your answer. Now, I can see white to dark points. Is it
possible to have pseudocolor based on intensity?

Not yet. But I'm working on new features that will provide much better support for uncoloured lidar data. With the next version of potree, data will be stored in las or laz files. This means, intensity won't have to be converted to rgb data. Instead, there will be materials that render the point cloud in different colors depending on the intensity value. It will take a some more weeks, though.

from potree.

BobsYurUnkle avatar BobsYurUnkle commented on June 1, 2024

Markus,

I am also working on trying to get the Z/Y axis flipped and I have read your instructions on applying the matrix transformation but I am uncertain where to put the "pointcloud.applyMatrix" command. Does it go in my .html file? Do I need to modify my three.js file?

Please clarify exactly which file(s) needs to be modified and exactly where in the file the above change should be located (if the location is important).

Thanks!

Jeremy

from potree.

m-schuetz avatar m-schuetz commented on June 1, 2024

It goes into the html file. Put the call right after the point cloud has been created:

pointcloud = new Potree.PointCloudOctree(pco, pointcloudMaterial);
pointcloud.applyMatrix(new THREE.Matrix4().set(
    1,0,0,0,
    0,0,1,0,
    0,1,0,0,
    0,0,0,1
));

from potree.

BobsYurUnkle avatar BobsYurUnkle commented on June 1, 2024

Markus,

Thanks so much for your reply and answer to my question. I added the pointcloud.applyMatrix immediately after the "pointcloud =" line as you said but after making the change my test HTML doc stops working. I am going to post the entirety of my example HTML file. When you have a moment could you please take a look and tell me what I am doing wrong?

I had to remove the HTML code because it was actually being used and making the rest of the script unviewable.

Thanks.


    <script src="../libs/three.js/build/three.js"></script>
    <script src="../libs/other/FirstPersonControls.js"></script>
    <script src="../src/Potree.js"></script>
    <script src="../src/PointCloudOctree.js"></script>
    <script src="../src/PointCloudOctreeGeometry.js"></script>
    <script src="../src/loader/POCLoader.js"></script>
    <script src="../src/loader/PointAttributes.js"></script>
    <script src="../src/utils.js"></script>
    <script src="../src/LRU.js"></script>
    <script>
            var renderer;
            var camera;
            var cube;
            var scene;
            var octreeNodesVisible = 0;
            var pointsVisible = 0;
            var pointCloud;
            var pointClouds = [];

            function initThree(){
                    scene = new THREE.Scene();
                    camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);

                    renderer = new THREE.WebGLRenderer();
                    renderer.setSize(window.innerWidth, window.innerHeight);
                    document.body.appendChild(renderer.domElement);

                    camera.position.z = 90;
                    camera.position.y = 0;
                    camera.position.x = 0;

                    var pointLight = new THREE.PointLight(0xffffff);
                    pointLight.position.set(10, 10, 10);
                    scene.add(pointLight);

                    var ambientLight = new THREE.AmbientLight(0x111111)
                    scene.add(ambientLight);

                    controls = new THREE.OrbitControls(camera);
                    controls.target.set(0, 3, 0);
                    camera.lookAt(new THREE.Vector3(0, 3, 0));

                    var material = new THREE.PointCloudMaterial( { size: 0.02, vertexColors: true } );
                    var pco = POCLoader.load("../resources/pointclouds/houseX10/cloud.js");

                    pointCloud = new Potree.PointCloudOctree(pco, material);
                    pointcloud.applyMatrix(new THREE.Matrix4().set(
                        1,0,0,0,
                        0,0,1,0,
                        0,1,0,0,
                        0,0,0,1
                    ));

                    pointCloud.LODDistance = 20;
                    pointCloud.rotation.x = Math.PI;

                    pointCloud.position.x = 8;
                    pointCloud.position.z = -2;
                    pointCloud.position.y = 4;

                    scene.add(pointCloud);
                    scene.add(createGrid(8,8,1));
            }


            function onDocumentMouseMove( event ) {
                    event.preventDefault();

                    mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                    mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
            }

            function createGrid(width, length, spacing){
                    var material = new THREE.LineBasicMaterial({
                    color: 0xBBBBBB
                });

                    var geometry = new THREE.Geometry();
                for(var i = 0; i <= length; i++){
                     geometry.vertices.push(new THREE.Vector3(-(spacing*width)/2, 0, i*spacing-(spacing*length)/2));
                             geometry.vertices.push(new THREE.Vector3(+(spacing*width)/2, 0, i*spacing-(spacing*length)/2));
                }

                for(var i = 0; i <= width; i++){
                     geometry.vertices.push(new THREE.Vector3(i*spacing-(spacing*width)/2, 0, -(spacing*length)/2));
                             geometry.vertices.push(new THREE.Vector3(i*spacing-(spacing*width)/2, 0, +(spacing*length)/2));
                }

                var line = new THREE.Line(geometry, material, THREE.LinePieces);
                line.receiveShadow = true;
                return line;
            }

            var toggle = 0;
            function render() {
                    requestAnimationFrame(render);

                    octreeNodesVisible = 0;
                    pointsVisible = 0;
                    scene.traverse( function ( object ) {
                            if ( object instanceof Potree.PointCloudOctree ) {
                                    object.update( camera );
                            }else if(object instanceof THREE.PointCloud){
                                    if(object.visible){
                                            octreeNodesVisible++;
                                            pointsVisible += object.numPoints;
                                    }
                            }
                    } );

                    renderer.render(scene, camera);

                    document.getElementById("lblNumVisibleNodes").innerHTML = "visible nodes: " + octreeNodesVisible;
                    document.getElementById("lblNumVisiblePoints").innerHTML = "visible points: " + pointsVisible;
            };

            initThree();
            render();

    </script>

    <div id="lblNumVisibleNodes" style="position: absolute; left: 10px; top: 20px; width: 400px; color:white"></div>
    <div id="lblNumVisiblePoints" style="position: absolute; left: 10px; top: 40px; width: 400px; color:white"></div>
    <div id="lblControl" style="position:absolute; left: 10px; top: 80px; width: 400px; color: white">
    Orbit Controls:<br>
    left mouse button: rotate object<br>
    right mouse button: pan the screen<br>
    scrool wheel: zoom in and out
    </div>

from potree.

m-schuetz avatar m-schuetz commented on June 1, 2024

Variable names are case sensitive. Rename pointcloud.applyMatrix to pointCloud.applyMatrix

it might also be neccessary to replace

pointCloud.position.x = 8;
pointCloud.position.z = -2;
pointCloud.position.y = 4;

with

pointCloud.position.set(8, -2, 4);

And last but not least, you're rotating around the x-axis with

    pointCloud.rotation.x = Math.PI;

Maybe this causes the flip-issue. Try to remove it.

from potree.

m-schuetz avatar m-schuetz commented on June 1, 2024

If you've still got problems, create a new issue. I'm closing this as the original question has been answered.

@Phatnine
New version of potree has coloring by intensity. See this example: http://potree.org/wp/lake_tahoe/
There are 2 examples (lion_las and lion_laz) in the potree/examples directory where you can switch between different materials for rgb, intensity and others.
You can use the PotreeConverter in the develop branch to convert las or laz files with intensity: https://github.com/potree/PotreeConverter/tree/develop

from potree.

yeojnai avatar yeojnai commented on June 1, 2024

help! i used potree to convert my las file and i put it to potree, reources folder i tried to view my las file to potree but there's no display.. heres my command PotreeConverter.exe D:\lasmergefile\lasfile\data.las -s 0.5 -l 4 -o C:/potree_converted please help! thanks :)

from potree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.