placementPoint
A position prop in the shape's own coordinates, so you can compare it with the field.
placementPoint(params: GpuFragmentParams, position: Expr, hint: string = 'placed'): Expr
Import materials from shaders/std and use materials.placementPoint.
Takes a transformPosition prop and applies the same center, scale and rotation the shape has. Distances from it are in placement units, not canvas units.
Parameters
| Name | Type | Notes |
|---|---|---|
params | GpuFragmentParams | |
position | Expr | |
hint | string | Optional. Default 'placed'. |
Example
const lightUV = placementPoint(params, params.uniforms.lightPosition)
See also
pointLightFrom— A point light as seen from a point on the shape: the 3D light vectorL, the 2D directiontoLightand thedistance.nearestEdge— The closest point on the shape's edge to this pixel, and the outward normal there.