Function ComputeOverlayCssTransform
-
ComputeOverlayCssTransform(
centerX: number,
centerY: number,
scaleX: number,
scaleY: number,
rotation: number,
elementWidth: number,
elementHeight: number,
): stringParameters
- centerX: number
projected center X in CSS pixels
- centerY: number
projected center Y in CSS pixels
- scaleX: number
horizontal scale to apply to the element
- scaleY: number
vertical scale to apply to the element
- rotation: number
in-plane rotation in radians
- elementWidth: number
element width in pixels
- elementHeight: number
element height in pixels
Returns string
the CSS transform string
- centerX: number
Builds the CSS
transformstring that positions an overlay element over the projected face of a mesh.The transform is applied with
transform-origin: 0 0. Reading right to left it centers the element on its own origin, scales and rotates it to match the projected face, then translates it to the projected center (in CSS pixels, top-left origin).