Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

polyline rendered error when positions set height in 2D. #12435

Open
wangzwswip opened this issue Jan 15, 2025 · 0 comments
Open

polyline rendered error when positions set height in 2D. #12435

wangzwswip opened this issue Jan 15, 2025 · 0 comments

Comments

@wangzwswip
Copy link

What happened?

when viewer mapMode2D set to MapMode2D.ROTATE. And the positions to create polyline include height, then the polyline dose not work. test code :

const viewer = new Cesium.Viewer("cesiumContainer", {mapMode2D: Cesium.MapMode2D.ROTATE});
viewer.scene.mode = 2;
// when set height, polyline dose not work
let positions = Cesium.Cartesian3.fromDegreesArrayHeights([100, 10, 100, 110, 10,100, 120, 20, 100]);
// when height = 0, it work
let positions2 = Cesium.Cartesian3.fromDegreesArray([100, 10, 110, 10, 120, 20]);
const line = new Cesium.GeometryInstance({
geometry: new Cesium.PolylineGeometry({
positions: positions,
width: 2,
vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT,
}),
attributes:{
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
}
});
let aa = new Cesium.Primitive({
geometryInstances: line,
asynchronous: false,
appearance: new Cesium.PolylineColorAppearance({
translucent: true,
}),
show: true
});
viewer.scene.primitives.add(aa);

Reproduction steps

...

Sandcastle example

No response

Environment

Browser: chrome
CesiumJS Version: 1.125
Operating System: windows 11

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant