CesiumGS / CesiumGS/cesium

GroundPrimitive Render Error

Open
#11,291 14 comments 0 reactions 0 assignees View on GitHub
category - polygons/geometry category - vector data type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

I want to use PolygonGeometry and groundPrimitive to draw Hexagonal Grids on Terrain, but there is a problem with the color rendering of the hexagonal grid, which goes out of the edge grid.And I check the edge points to ensure points are correct.
`hexagonInstances.push(new Cesium.GeometryInstance({
geometry: new Cesium.PolygonGeometry({
polygonHierarchy: new Cesium.PolygonHierarchy(geoInfo.cartesian3Data as Cesium.Cartesian3[]),
vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
id: "Hexagon-" + geoInfo.indexX + "_" + geoInfo.indexY,
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(this.config.showSatelliteImage?color.withAlpha(0.2):color.withAlpha(0.8))
}
}))

this.viewer.scene.primitives.add( new Cesium.Primitive({
geometryInstances: hexagonInstances,
interleave: true,
vertexCacheOptimize: true,
allowPicking: false,
asynchronous: false,
appearance: new Cesium.PerInstanceColorAppearance({
flat: true
})
}), 0)
`

![L3_W3O2O $UWJZDTOF MB](https://github.com/CesiumGS/cesium/assets/26219522/0efa8c28-975d-4fe2-9319-2291ddfe960e)

Contributor guide

Open the contributing guide

Research direction

Start with the GroundPrimitive and PolygonGeometry rendering path, using the provided hexagonInstances code and screenshot as the reproduction context. Inspect how polygon edges are rendered over terrain and verify the edge color against the supplied Cartesian3 points. Done means the hexagonal grid stays within its intended boundaries when rendered on terrain.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.