Skip to main content

Function: computeBillboardScale()

computeBillboardScale(imageWidth, imageHeight, maxSize, target): Vector2

Defined in: src/generative/GenerativeObjectUtils.ts:19

Computes an aspect-ratio-preserving plane size whose largest side equals maxSize. Used to scale a generated image so it reads at a comfortable size regardless of the model's output resolution.

Parameters​

imageWidth​

number

Source image width in pixels.

imageHeight​

number

Source image height in pixels.

maxSize​

number

Largest dimension of the resulting plane, in meters.

target​

Vector2 = ...

Optional output vector to write into.

Returns​

Vector2

target set to the plane's [width, height] in meters.