i want use “primitives” add rectangle,not use “entities” add rectangle.because “entities” no “modelMatrix” property. so primitive appearance how to define video material .
var videoElement = document.getElementById(‘trailer’);
function createPrimitives() {
let instance = new Cesium.GeometryInstance({
id: ‘go’,
geometry: new Cesium.RectangleGeometry({
rectangle: Cesium.Rectangle.fromDegrees(-30, -10, 30, 10),
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
//vertexFormat: MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat
}),
attributes: {
//color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
}
});
scene.primitives.add(new Cesium.Primitive({
geometryInstances: instance,
appearance: new Cesium.MaterialAppearance({
material: videoElement
}),
releaseGeometryInstances: false,
}));
}
An error occurred while rendering. Rendering has stopped.
TypeError: this.material.isTranslucent is not a function
TypeError: this.material.isTranslucent is not a function
at p.s.isTranslucent (http://localhost:51309/Build/Cesium/Cesium.js:477:8801)
at V.update (http://localhost:51309/Build/Cesium/Cesium.js:483:17425)
at a.update (http://localhost:51309/Build/Cesium/Cesium.js:493:10489)
at nt (http://localhost:51309/Build/Cesium/Cesium.js:528:17162)
at et (http://localhost:51309/Build/Cesium/Cesium.js:528:14874)
at Je (http://localhost:51309/Build/Cesium/Cesium.js:528:12880)
at dt (http://localhost:51309/Build/Cesium/Cesium.js:528:21418)
at ht (http://localhost:51309/Build/Cesium/Cesium.js:528:21607)
at Ee.render (http://localhost:51309/Build/Cesium/Cesium.js:528:29455)
at A.render (http://localhost:51309/Build/Cesium/Cesium.js:535:9556)
``