Entwine generated 3D Tiles from Original PointCloud File (.PLY) dont appear inside bounding boxes

Hello to everyone

I have some PointClouds files (.PLY) with no Coordinate reference system associated, my objective is to see/interact with these Point Clouds using CesiumJS on the browser.

I´m dividing these procedure in 3 Main steps :

1º {Convert .PLY to .LAZ}

2º {Generate 3D Tiles with Entwine}

3ª {Serve the tiles with local HTTP Server with CORS Enabled (http://192.168.99.100:8080/tileset.json)}

4ª {Use Client Page to Load 3D Tile susing CesiumJS}

"Convert .PLY to .LAZ"

To do so i have used 2 approachs : First usingCloudCompare (NOT Setting Origin SRS), second using LIDAR (Setting Origin SRS)

Cloud2Compare Approach” :

**1º **I’ve opened the .PLY file on Cloud2Compare with Global Shift Settings(Max Absolute Coordinate = 10^6, Max Absolute Diagonal = 10^6)

Save the File as .LAZ

Goto [Step Generate 3D Tiles with Entwine]

LIDAR Approach” :

1º I’ve opened the .PLY file on LIDAR

2ª Went to “Menu Data Management”->“Projections And Transformations”->“Define Projection”

  • Set the Projection as “EPSG:4326”

3º Exported the File as .LAZ

4ª Goto [Step Generate 3D Tiles with Entwine]

Generate 3D Tiles with Entwine

Generation of 3D tiles converting the .PLY data using the following steps:

Build ECF (Entwine Tiles) from .PLY

docker run -it -v /entwine:/entwine connormanning/entwine build -c /entwine/source-pclouds/input/ecfBuild.json

``

NOTE: Contents of ecfBuild.json :

         {
          "absolute":false,
                       
          "input": "/entwine/source-pclouds/input/testCloud.laz",
                           
          "output": "/entwine/source-pclouds/input/ecf",
                           
          "scale": [0.00001, 0.00001, 0.000025],
                           
          "reprojection": {
                           "in" : "EPSG:3763",
                           "out" : "EPSG:4978"
           },
          "formats": {
                       "cesium":{
                                  "tilesetSplit": 8,
                                  "geometricErrorDivisor": 16.0
                              }
                       }
          }

``

Generate Cesium Tile Format :

docker run -it -v /entwine:/entwine connormanning/entwine convert -i /entwine/source-pclouds/input/ecf -o /entwine/source-pclouds/output/cesium --truncate

``

Serve the tiles with local HTTP Server with CORS Enabled

docker run -it -v /entwine/source-pclouds/output/cesium:/var/www -p 8080:8080 connormanning/http-server

``

Use Client Page to Load 3D Tile using CesiumJS

.JS Code i’m using on the client App

//Intended location : Portugal, Pinhão

var cartographic = Cesium.Cartographic.fromDegrees(-7.544, 41.186,0.01);

var cartesian = Cesium.Cartographic.toCartesian(cartographic);

var transform = Cesium.Transforms.headingPitchRollToFixedFrame(cartesian, new Cesium.HeadingPitchRoll());

var debugTiles = true;

var tileset3D = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({

                                                                  url : 'http://192.168.99.100:8080/tileset.json',

                                                                  debugWireframe : debugTiles,

                                                                  debugShowBoundingVolume : debugTiles,

                                                                  debugShowContentBoundingVolume : debugTiles,

                                                                  debugShowViewerRequestVolume : debugTiles,

                                                                  modelMatrix: transform,

                                                                  cullWithChildrenBounds : true,

                                                                  cullRequestsWhileMoving : false,

                                                                  foveatedScreenSpaceError : false,

                                                                  debugShowUrl : debugTiles,

                                                                  show: true,

                                                                  //ellipsoid : Cesium.Ellipsoid.UNIT_SPHERE

                                                                }));

``

PROBLEM(S):

First*:***

Running the code above…

What happens is that i see the bounding Volume Boxes the “wireframes like structure” but inside them there are no points, its empty !

When press F12 on the browser and check Network TAB, i see that the browser gets all *.pnts with a 200 OK when i’m zooming In / Out, as expected.

*Second *:

Another Problem when i Remove /comment the " //modelMatrix: transform" i go to the middle of the Ocean on North Pole and i Dont see any bounding boxes.

When press F12 on the browser and check Network TAB, i see that the browser gets all *.pnts with a 200 OK when i’m zooming In / Out, as expected.

Checking that problem wasn’t related with my .JS code

I’ve tried with tiles avaiable online and it works just fine example : http://cesium.entwine.io/data/st-helens/cesium/tileset.json

I know that theres definetly some problem with my data or the generation of the tiles himselfs.

*- *What are the right steps to generate the 3D Tiles using Entwine ?

**- **Has anyone has already faced the same problems ?

I would really appreciate some answer.

Best Regards,

João Sá

I think there are several things that might be the issue here. To narrow it down, I’m curious if you’re tried creating your 3D Tiles with Cesium ion (https://cesium.com/ion/). You can just drag and drop your LAZ files there. If that doesn’t work, you can send me a Sandcastle link that’ll help debug whether this is a CesiumJS issue or a data issue.

Hi Omar,

First of all thanks for your fast reply : )

I import the .laz file directly into Cesium Ion assets.

And the Cesium client side code works has expected i can see

the point clouds inside bounding boxes has expected.

Is there specific way to generate the 3D tiles ?

What would be the expected pipeline for sucessfully,

generate the 3d tiles from original .ply or.las .laz files !

Thanks so much.

Best Regards,

João Sá

Yeah I think it simply may be that the 3D Tileset you had before was not generated correctly. I would compare the output (you can check the network tab to see the individual tiles) to perhaps see where the difference or problem might lie.

Thanks Omar for the reply : )

Problem was with the3D Tileset generation, now it shows all the points (300Million) : )

The only problem that i have now is that when i apply a Matrix transform to the 3D tiles to the suposed location where i want them to be, they go more up north then i want them to.

For example i want to position the 3D Tiles on the following Coordinates :

41°11’22.3"N 7°32’08.1"W

This Corresponds in Google Maps to Pinhão:

PINHAO.png

If i Zoom Out Pinhão:

pinhaoZOOMOUT.png

In JS (Cesium Values aproximately) :

var cartographic = Cesium.Cartographic.fromDegrees(-7.532204, 41.188068, 0);

var cartesian = Cesium.Cartographic.toCartesian(cartographic);

var transformMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(cartesian, new Cesium.HeadingPitchRoll(0,0,0));

Tiles Go to North Galiza Spanish region

Wrong Position of Tiles somewhere Between “Balboa” and “Cantejeira” :

notpinhaoZOOMIN.png

Wrong Zoom Out position :

notpinhaoZOOMOUT.png

I think that the problem is in Coordinate reference system that i’ve defined **EPSG:4326, **i probably need to know original projection to reproject the data to this projection (EPSG:4326)

instead of defining its original has this EPSG:4326.

Please tell me what do you think Omar.

Best Regards,

João Sá

Omar Shehata omar.sameh.shehata@gmail.com escreveu no dia sexta, 28/06/2019 à(s) 22:21:

I think this may have to do with where/how the origin of the 3D Tileset is computed. One thing you can to figure this out is use the tileset location editor in ion to set it to the correct location, visually, and then inspect the tileset’s root transform in Sandcastle to give you an idea of what the correct values to offset should be.

Thanks Omar.

I’ll Try That.

Best Regards,

João de Sá

Omar Shehata omar.sameh.shehata@gmail.com escreveu no dia terça, 2/07/2019 à(s) 21:04: