《Cesium实战(十二)使用Primitive替代entity》的评论 http://cesium.xin/wordpress/archives/cesium-primitive-entity.html 学习cesiumjs 的好地方--伐罗密 Mon, 21 Apr 2025 02:06:23 +0000 hourly 1 https://wordpress.org/?v=4.9.26 作者:yangqy611 http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-3669 Tue, 19 Dec 2023 01:23:58 +0000 http://cesium.xin/wordpress/?p=1419#comment-3669 你好,使用primitive 画几何体,按照你的参数
vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL

appearance : new Cesium.PerInstanceColorAppearance({
translucent : false,
closed : true
})
看起来还是没有立体感,这个要怎么解决呢

]]>
作者:wforguo http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-3438 Wed, 22 Feb 2023 09:26:07 +0000 http://cesium.xin/wordpress/?p=1419#comment-3438 去掉vertexFormat就没报错了

]]>
作者:aaa http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-1882 Fri, 05 Mar 2021 03:40:50 +0000 http://cesium.xin/wordpress/?p=1419#comment-1882 这个问题解决了吗?我也遇到了

]]>
作者:gzw http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-1796 Thu, 21 Jan 2021 07:28:35 +0000 http://cesium.xin/wordpress/?p=1419#comment-1796 你好 同样的问题 请问你最后怎么解决的 感谢帮助!!

]]>
作者:Elusive http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-868 Wed, 17 Jun 2020 15:18:31 +0000 http://cesium.xin/wordpress/?p=1419#comment-868 cesium1.66 可以运行,代码和视频发你邮箱了

]]>
作者:540251376 http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-867 Wed, 17 Jun 2020 08:28:02 +0000 http://cesium.xin/wordpress/?p=1419#comment-867 我把所有的vertexFormat都试了一次,都报那个错,这是我的代码,大神麻烦您帮我看看吧,谢谢呀

]]>
作者:540251376 http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-866 Wed, 17 Jun 2020 08:26:22 +0000 http://cesium.xin/wordpress/?p=1419#comment-866 function creatgxPolylinePrimit(positions, linewidth, linecolor, img, speed, isClose) {
var cvs = img;

var pl = new Cesium.PolylineVolumeGeometry({
polylinePositions: positions,
shapePositions: computeCircle(linewidth),
vertexFormat: Cesium.VertexFormat.POSITION_ONLY
});
var ins = new Cesium.GeometryInstance({
geometry: Cesium.PolylineVolumeGeometry.createGeometry(pl),

attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED),
}
})
// var ins = GeometryIns(pl);
var linesInstances = [];
linesInstances.push(ins);

var cesiumColor = Cesium.Color.fromCssColorString(linecolor);
var appc = new Cesium.PolylineMaterialAppearance({
material: new Cesium.Material({
fabric: {
uniforms: {
image: cvs,
animationSpeed: speed,
color: cesiumColor
},
source: “czm_material czm_getMaterial(czm_materialInput materialInput) { \n\
czm_material material = czm_getDefaultMaterial(materialInput);\n\
vec2 st = materialInput.st;\n\
float time = czm_frameNumber * animationSpeed;\n\
vec4 colorImage = texture2D(image,vec2(fract(st.s – time), st.t));\n\
material.alpha = colorImage.a;\n\
material.diffuse = colorImage.rgb;\n\
return material;\n\
} \n”,
// aboveGround: true,

},
}),
})
// var curPrimitive = primitv(linesInstances, appc);
var curPrimitive = new Cesium.Primitive({
geometryInstances: linesInstances,
appearance: appc,
asynchronous: false
});
curPrimitive = window.CesiumViewer.scene.primitives.add(curPrimitive);
return curPrimitive;

}

]]>
作者:Elusive http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-865 Wed, 17 Jun 2020 06:09:11 +0000 http://cesium.xin/wordpress/?p=1419#comment-865 定位一下错误,或者看你的attributes是不是写错了啥的,你这么描述,不太知道是什么回事。。。

]]>
作者:Elusive http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-864 Wed, 17 Jun 2020 06:08:21 +0000 http://cesium.xin/wordpress/?p=1419#comment-864 API里面查找一个vetexformat的类型,换成别的试一试

]]>
作者:540251376 http://cesium.xin/wordpress/archives/cesium-primitive-entity.html#comment-863 Wed, 17 Jun 2020 03:29:41 +0000 http://cesium.xin/wordpress/?p=1419#comment-863 当我改成动态渲染时会报这个错:The appearance requires vertex shader attribute input ‘prevPosition2DHigh’, which was not computed as part of the Geometry. Use the appearance’s vertexFormat property when constructing the geometry.大神,帮帮我吧

]]>