1. A concise explanation of the problem you're experiencing.
I am attempting to render a PolygonGeometry specified in ENU. The polygon is in a Primitive with a modelMatrix of Transforms.eastNorthUpToFixedFrame. The polygon renders in the correct location about the specified origin, but at an extremely large altitude. I am trying to understand why I am getting such behavior, as the DebugModelMatrixPrimitive is in the correct location and I can perform the same transformation on a PointPrimitiveCollection without issue.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer('cesiumContainer');
var pts = [1, 0, 5, 0, 1, 5, -1, 0, 5, 0, -1, 5];
var center = Cesium.Cartesian3.fromDegrees(-105.637313, 40.593446);
var instance = new Cesium.GeometryInstance({
id : 'TEST',
geometry : new Cesium.PolygonGeometry({
polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.unpackArray(pts)),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
height: 2
}),
attributes : {
show : new Cesium.ShowGeometryInstanceAttribute(true)
}
});
var primitive = new Cesium.Primitive({
geometryInstances : [instance],
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(center),
appearance : new Cesium.EllipsoidSurfaceAppearance(
{
flat : true,
material : new Cesium.Material({fabric : {
type : 'Color',
uniforms : { color : new Cesium.Color(0.0, 0.0, 1.0, 0.2) }
}})
}),
shadows : Cesium.ShadowMode.DISABLED,
show: true
});
var collection = new Cesium.PrimitiveCollection();
collection.add(primitive);
viewer.scene.primitives.add(collection);
viewer.scene.primitives.add(new Cesium.DebugModelMatrixPrimitive({
modelMatrix : primitive.modelMatrix,
length : 100000.0,
width : 5.0
}));
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I am attempting to render thousands of polygons. I can accomplish my goals using ECEF specified locations, but am wishing to be able to specify the polygon points in ENU in order to be able to transform the collection through manipulation of the modelMatrix.
4. The Cesium version you're using, your operating system and browser.
1.46, Mac OS Sierra v.10.12.6, Chrome