Can we convert position from Cesium Projection to Potree Projection?

In this example they use function toCes to convert potree camera position into Cesium Projection
let toCes = (pos) => {

let xy = [pos.x, pos.y];

let height = pos.z;

    let deg = window.toMap.forward(xy);

    let cPos = Cesium.Cartesian3.fromDegrees(...deg, height);

return cPos;



I am finding vice-versa for this function.

I have written than function but that does not giving me correct position

let toPot = (pos) => {

let xy = [pos.x,pos.y]

pPos = window.toScene.forward(xy);

pPos = new THREE.Vector3(…pPos, pos.z);

return pPos;



How are you testing if it’s the correct position? Do you have sample data or Sandcastle example ( I can check?