You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to render the polyline with the marterial of PerInstanceColorAppearance,But it's seem to not take effet with the following code.
I finally made it when I use SimplePolylineGeometry to construct instance.So I want to understand what's the diffrent of PolylineGeometry and SimplePolylineGeometry on this point.
instanceFunction
function getGeometryInstance (lineStringArray) {
return new Cesium.GeometryInstance({
geometry : new Cesium.SimplePolylineGeometry({
positions : Cesium.Cartesian3.fromDegreesArrayHeights(lineStringArray),
width : this.style.width,
dashLength : 60,
vertexFormat : Cesium.PolylineColorAppearance.POSITION_ONLY
}),
attributes : {
color :Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 0.5}))
}
});
}
var instances=[]
let arr=[116.2440766312067, 40.07389305730007, 34.855640866749, 116.24395125626549, 40.07382653757002, 34.9963782427669]
instances.push(getGeometryInstance(arr))
arr=[116.24393223274961, 40.073864289142065, 34.97, 116.24400014887023, 40.07389668017142, 34.870453622917]
instances.push(getGeometryInstance(arr))
addprimitive
var primitive= viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances : instances,
appearance : new Cesium.PerInstanceColorAppearance({
flat : true,
translucent : false
}),
asynchronous:false,
}))
The text was updated successfully, but these errors were encountered:
I want to render the polyline with the marterial of PerInstanceColorAppearance,But it's seem to not take effet with the following code.
I finally made it when I use SimplePolylineGeometry to construct instance.So I want to understand what's the diffrent of PolylineGeometry and SimplePolylineGeometry on this point.
instanceFunction
function getGeometryInstance (lineStringArray) { return new Cesium.GeometryInstance({ geometry : new Cesium.SimplePolylineGeometry({ positions : Cesium.Cartesian3.fromDegreesArrayHeights(lineStringArray), width : this.style.width, dashLength : 60, vertexFormat : Cesium.PolylineColorAppearance.POSITION_ONLY }), attributes : { color :Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromRandom({alpha : 0.5})) } }); }var instances=[]
let arr=[116.2440766312067, 40.07389305730007, 34.855640866749, 116.24395125626549, 40.07382653757002, 34.9963782427669]
instances.push(getGeometryInstance(arr))
arr=[116.24393223274961, 40.073864289142065, 34.97, 116.24400014887023, 40.07389668017142, 34.870453622917]
instances.push(getGeometryInstance(arr))
addprimitive
var primitive= viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances : instances,
appearance : new Cesium.PerInstanceColorAppearance({
flat : true,
translucent : false
}),
asynchronous:false,
}))
The text was updated successfully, but these errors were encountered: