Generate 3D tiles in CPP

Coincidentally, it looks like the reason here is the same as in another recent thread: The PNTS file contains the vertices “centered at the origin”. The tileset JSON defines a bounding region, which is a place at the surface of the earth. So this just does not match.

I have not yet looked at the code that you posted. My first hint for debugging would have been what you apparently tried out later, namely, actually writing the data into files (which are much easier to analyze than a server that generates the data on the fly). But you might want to check the computation of the bounding region. I think that adding a root.transform in the tileset JSON (as described in the linked thread) might solve this issue here as well.

Just from a local experiment: Here is a tileset JSON that uses a bounding box:

{
  "asset": {
    "version": "1.1"
  },
  "geometricError": 4096,
  "root": {
    "boundingVolume": {
      "box": [
        0,
        0,
        3500,
        5955.3779296875,
        0,
        0,
        0,
        3114.458740234375,
        0,
        0,
        0,
        500
      ]
    },
    "geometricError": 512,
    "content": {
      "uri": "content.pnts"
    },
    "refine": "ADD"
  }
}

And that can be displayed with this sandcastle, which manually places the tileset at a certain position on the globe:

const viewer = new Cesium.Viewer("cesiumContainer");

// Create the tileset in the viewer
const tileset = viewer.scene.primitives.add(
  await Cesium.Cesium3DTileset.fromUrl(
    "http://localhost:8080/tileset-new.json", {
    debugShowBoundingVolume: true,
  })
);

// Move the tileset to a certain position on the globe
const transform = Cesium.Transforms.eastNorthUpToFixedFrame(
  Cesium.Cartesian3.fromDegrees(-75.152408, 39.946975, 20)
);
const scale = 1.0;
const modelMatrix = Cesium.Matrix4.multiplyByUniformScale(
  transform,
  scale,
  new Cesium.Matrix4()
);
tileset.modelMatrix = modelMatrix;

// Zoom to the tileset, with a small offset so that
// it is fully visible
const offset = new Cesium.HeadingPitchRange(
  Cesium.Math.toRadians(-22.5),
  Cesium.Math.toRadians(-22.5),
  60.0
);
viewer.zoomTo(tileset, offset);