1. A concise explanation of the problem you’re experiencing.
I want to use the Cesium.Cartesian3.fromArray() coordinates, so that I can work in xyz. Then when I create my entity, I want to position it somewhere on the globe relative to an origin specified in degrees, so my xyz origin gets moved.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer(‘cesiumContainer’);
//create points using xyz
var points3 = ;
points3.push(Cesium.Cartesian3.fromArray([0, 0, 0]));
points3.push(Cesium.Cartesian3.fromArray([1e5, 0, 0]));
points3.push(Cesium.Cartesian3.fromArray([1e5, 1e5, 0]));
console.log(points3);
//create the polygon
var redPolygon = viewer.entities.add({
name : ‘Red polygon on surface’,
position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0),
polygon : {
hierarchy : points3,
material : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I am generating different building designs, I do not want to work in degrees.
4. The Cesium version you’re using, your operating system and browser.
Cesium sandbox, Windows 7, Chrome 67