I have a point cloud. I load it on Cesium by converting to a GLTF file. The model loading script is as below.
GpsX and GpsY corresponds to the origin [0,0,0] in the original point cloud.
My problem is to know the GpsX2 and GpsY2 for another point in the cloud which has [x2,y2,z2] values in the original point cloud.
Would you have advice to achieve earth coordinates of other points in the point cloud after they are loaded?
// Loading the point cloud as GLTF model:
roomModelGpsX = GpsX;
roomModelGpsY = GpsY;
roomModelHeight = firstFloorHeight;
roomModelPosition = Cesium.Cartesian3.fromDegrees(roomModelGpsY, roomModelGpsX, roomModelHeight);
headingAngle = Cesium.Math.toRadians(0);
roomModelPitch = 0;
roomModelRoll = 0;
hpr = new Cesium.HeadingPitchRoll(headingAngle, roomModelPitch, roomModelRoll);
orientation = Cesium.Transforms.headingPitchRollQuaternion(roomModelPosition, hpr);
roomModel = viewer.entities.add({
name: 'room model',
position: new Cesium.Cartesian3.fromDegrees(roomModelGpsY[i], roomModelGpsX[i], roomModelHeight[i]),
orientation: orientation,
model: {
uri: roomModelUrl,
scale: 1
},
allowPicking: true
});