Open mramato opened 9 years ago
When using asynchronous Primitive, if you pass it a geometry that is already created, it will through because of lack of _workerName. We should detect already created geometry and handle it accordingly and only throw if the Geometry isn't created.
Primitive
_workerName
forum post
var viewer = new Cesium.Viewer('cesiumContainer'); var scene = viewer.scene; var length = 400000.0; var positionOnEllipsoid = Cesium.Cartesian3.fromDegrees(-100.0, 40.0); var modelMatrix = Cesium.Matrix4.multiplyByTranslation( Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid), new Cesium.Cartesian3(0.0, 0.0, length * 0.5), new Cesium.Matrix4() ); var cylinderGeometry = Cesium.CylinderGeometry.createGeometry(new Cesium.CylinderGeometry({ length : length, topRadius : 200000.0, bottomRadius : 200000.0, vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT })); var greenCylinder = new Cesium.GeometryInstance({ geometry : cylinderGeometry, modelMatrix : modelMatrix, attributes : { color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.GREEN) } }); scene.primitives.add(new Cesium.Primitive({ geometryInstances : [greenCylinder], appearance : new Cesium.PerInstanceColorAppearance({ closed : true, translucent: false }) }));
I ran into this bug today. Took a while to find the solution.
When using asynchronous
Primitive
, if you pass it a geometry that is already created, it will through because of lack of_workerName
. We should detect already created geometry and handle it accordingly and only throw if the Geometry isn't created.forum post