iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.09k stars 293 forks source link

How to place and rotate potree point cloud ? #2175

Open ketourneau opened 1 year ago

ketourneau commented 1 year ago

We try to load many potree point cloud in same view but we got placement problem. We try to place the point clouds after loading them but it seems that bounding box is not updated so point cloud is not rendering correctly. Does anyone know how we can rotate and move point cloud after loading them (or before) with bounding box updated ?

Point clouds are not necessarily georeferenced, we'd like to place them as in the collada example :

                // building coordinate
                const coord = new itowns.Coordinates(
                    'EPSG:4326', 4.2165, 44.844, 1417,
                );

                model.position.copy(coord.as(view.referenceCrs));
                // align up vector with geodesic normal
                model.lookAt(model.position.clone().add(coord.geodesicNormal));
                // user rotate building to align with ortho image
                model.rotateZ(-Math.PI * 0.2);
                model.scale.set(1.2, 1.2, 1.2);
ketourneau commented 2 weeks ago

Since this PR is accepted, we now place potree point cloud with parent object3d but we still got some rendering issue.

Point cloud is not correctly rendering (maybe bouding box still not updated ?) : https://demo-hackathon.netlify.app/examples/demo_hackathon_orvault_planarview

Source code here : https://github.com/bloc-in-bloc/itowns/blob/19f14c00e09280cc2e7065919a1a83c768df3f4a/examples/demo_hackathon_orvault_planarView.html#L306