跳到主要内容

flywave-map-controls.calculatenormalizeddevicecoordinates

Home > @flywave/flywave-map-controls > calculateNormalizedDeviceCoordinates

calculateNormalizedDeviceCoordinates() function

Transforms the given point in screen space into NDC space by taking the given screen dimension into account.

Signature:

export declare function calculateNormalizedDeviceCoordinates(screenCoordinateX: number, screenCoordinateY: number, screenSizeX: number, screenSizeY: number): Vector2;

Parameters

Parameter

Type

Description

screenCoordinateX

number

X coordinate in screen space.

screenCoordinateY

number

Y coordinate in screen space.

screenSizeX

number

Width of the reference screen size.

screenSizeY

number

Height of the reference screen size.

Returns:



Vector2