class.ScreenSpaceConversions
API > ScreenSpaceConversions
Class: ScreenSpaceConversions
Constructors
constructor
new ScreenSpaceConversions(
drawContext
):ScreenSpaceConversions
Parameters
Parameter | Type |
---|---|
drawContext | DrawContext |
Returns
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
Parameter | Type | Description |
---|---|---|
point | ReadonlyVec3 | World 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
Parameter | Type | Description |
---|---|---|
points | ReadonlyVec2 [] | 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
Parameter | Type | Description |
---|---|---|
points | ReadonlyVec3 [] | 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
Parameter | Type | Description |
---|---|---|
points | ReadonlyVec3 [] | 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.