Build the world→screen transform matrix for a View. Use as the transform field of a kind: 'group' DrawCommand to wrap world-space content emitted from a layer draw implementation.
View
transform
kind: 'group'
draw
Mapping: screen = (world − {view.x, view.y}) × {view.scale.x, view.scale.y}.
screen = (world − {view.x, view.y}) × {view.scale.x, view.scale.y}
Column-major layout (matches mat3.identity()): [scale.x, 0, 0, 0, scale.y, 0, -view.x*scale.x, -view.y*scale.y, 1].
mat3.identity()
[scale.x, 0, 0, 0, scale.y, 0, -view.x*scale.x, -view.y*scale.y, 1]
Build the world→screen transform matrix for a
View. Use as thetransformfield of akind: 'group'DrawCommand to wrap world-space content emitted from a layerdrawimplementation.Mapping:
screen = (world − {view.x, view.y}) × {view.scale.x, view.scale.y}.Column-major layout (matches
mat3.identity()):[scale.x, 0, 0, 0, scale.y, 0, -view.x*scale.x, -view.y*scale.y, 1].