Skip to main content

class.ScreenSpaceConversions

API > ScreenSpaceConversions

Class: ScreenSpaceConversions

Constructors

constructor

new ScreenSpaceConversions(drawContext): ScreenSpaceConversions

Parameters

ParameterType
drawContextDrawContext

Returns

ScreenSpaceConversions

Source

@novorender/web_app/screen_space_conversions.ts:7

Properties

drawContext

readonly drawContext: DrawContext

Source

@novorender/web_app/screen_space_conversions.ts:7

Methods

isInView

isInView(point): boolean

Check if world space point is inside the current view.

Parameters

ParameterTypeDescription
pointReadonlyVec3World space point that will be checked.

Returns

boolean

True if the point is inside the view false otherwise.

Source

@novorender/web_app/screen_space_conversions.ts:13


screenSpaceToWorldSpace

screenSpaceToWorldSpace(points): ReadonlyVec3[]

Convert 2D pixel point to 3D positions.

Parameters

ParameterTypeDescription
pointsReadonlyVec2[]Screen points in points that will be projected to world space.

Returns

ReadonlyVec3[]

Corresponding 3D positions at the view plane in world space.

Source

@novorender/web_app/screen_space_conversions.ts:83


worldSpaceToScreenSpace

worldSpaceToScreenSpace(points): (undefined | ReadonlyVec2)[]

Converts world space points to on screen space points.

Parameters

ParameterTypeDescription
pointsReadonlyVec3[]World space points that will be projected to screen space.

Returns

(undefined | ReadonlyVec2)[]

Screen space points regadless if they are within the current canvas size or undefined if point is outside screen space.

Source

@novorender/web_app/screen_space_conversions.ts:33


worldSpaceToViewSpace

worldSpaceToViewSpace(points): ReadonlyVec2[]

Converts world space points to view space points.

Parameters

ParameterTypeDescription
pointsReadonlyVec3[]World space points that will be projected to view space.

Returns

ReadonlyVec2[]

View space points regadless if they are within the current canvas size. Coordinates are in [0, 1] range.

Source

@novorender/web_app/screen_space_conversions.ts:60