Potree2 PointCloud doesn't appear with PlanarView
Since https://github.com/iTowns/itowns/pull/2498
Potree2 point clouds no longer appear with PlanarView.
Source code : https://github.com/bloc-in-bloc/itowns/blob/f/potree2-planarView-bug/examples/view_25d_map.html#L108
Before https://github.com/iTowns/itowns/pull/2498
After https://github.com/iTowns/itowns/pull/2498
I indeed forgot to update the Potree2BrotliLoader... I open a PR #2635 to correct this oversight.
A refactorization between the commun part of the 2 Potree2Loader, should be done, to avoid similar oversight later on...
The PR #2635 fixing this had been merged into master. Can you confirme that the bug is fixed ? @ketourneau Thanks in advance !
Thanks for the fix ! It's work now in the simple example but it still doesn't work in our use case (custom controls, custom renderer, custom camera) https://github.com/bloc-in-bloc/itowns/blob/f/custom-pointcloud-sample/examples/demo_hackathon_orvault_planarView.html
On master branch (demo_hackathon_orvault_planarView.html) :
Before the changes on point cloud (demo_hackathon_orvault_planarView.html) :
From what I started to check, it's a problem with the matrixWorld of the camera3D of the custom camera. The update loop calculate that the bbox of the node are not in the cameraSpace... https://github.com/iTowns/itowns/blob/628f03ec1fe0b7953996c4728eb8c62a2e73c15e/packages/Main/src/Renderer/Camera.js#L230
How could it work before changes on pointcloud ?
Before the changes the crs was not at all taking into account... meaning that whatever crs you was saying the data were considered as in the default crs, and everthing else was considered in the same crs. Now the crs is really considered from pointCloudData, and we need to be sure that your custom camera is well defined in the data crs.
@ftoromanoff How I can help you to debug ?
This example uses a custom Camera and a custom Renderer. It seems pretty complex for me and it's hard to understand was is the purpose of it.. I will advice to start again from a basic example and add little by little the different aspects of what you want to show in your example. With this approach you might find where exactly the bug appears... As the basic example seems to work fine, it might not directly be the reprojection that causes the bug...
Ok, thanks for the reply. I'll try starting again from the basic example with just a custom camera for debuging (without custom renderer).
I have updated our custom sample which reproduce the problem : https://github.com/bloc-in-bloc/itowns/commit/73ea8b37fea8786d1aa4f320d6c65b0c2f5aa923
After analysis with @ftoromanoff there seems to be a problem with the matrix world of clampOBB used to determine if element is visible in PointCloudLayer.
A little more explanation about our use case : We need to place the itowns Planar View to a specific position because we display georeferenced data outside itowns context. The ThreeJS scene center (0,0,0) must match the georeferenced BBOX center. So we must apply an "offset" (position and rotation) to the itowns planar view (by object3d parameter) to match our system.
iTownsViewRoot => offset position
└─ pivot => offset rotation, passed to PlanarView as object3D parameter
└─ PointCloudGroup => Passed to Potree2Layer as object3D parameter
Does anyone have any idea how to take into account object3D parameter to correctly rendering point cloud since #2498 ? More specifically, I notice a breaking (for our use case) since this commit.
@ketourneau Can you try #2656 ?