deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

[Feat]: Allow modelMatrix in SolidPolygonLayer to be data-driven like getPolygon

Open xiaomo1q opened this issue 3 months ago • 0 comments

Target Use Case

When rendering multiple dynamic geometries (e.g., polygons, extruded buildings, cubes), each instance may have its own rotation, translation, or scaling. Currently, this often requires creating multiple layers with different modelMatrix values, which increases memory usage and render overhead. By allowing modelMatrix to be data-driven—similar to how getPolygon, getOrientation, works—each instance can define its own transformation within a single layer.

Proposal

Add a new accessor such as getModelMatrix to SolidPolygonLayer, SimpleMeshLayer, PathLayer, and other layers that support transformations: new SolidPolygonLayer({ data, getPolygon: d => d.polygon, getOrientation: d=> [0, d.yaw,0] getModelMatrix: d => d.modelMatrix }) This change would make it easier to render many instances with independent transformations within a single layer, improving both performance and API consistency.

xiaomo1q avatar Oct 16 '25 03:10 xiaomo1q