@novorender/web_app / ScreenSpaceConversions
Class: ScreenSpaceConversions
Constructors
new ScreenSpaceConversions()
new ScreenSpaceConversions(drawContext): ScreenSpaceConversions
Parameters
Parameter | Type |
---|---|
drawContext | DrawContext |
Returns
Defined in
@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.
Defined in
@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.
Defined in
@novorender/web_app/screen_space_conversions.ts:89
worldSpaceToScreenSpace()
worldSpaceToScreenSpace(points, __namedParameters): (undefined | vec2)[]
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. |
__namedParameters | object | - |
__namedParameters.height ? | number | - |
__namedParameters.round ? | boolean | - |
__namedParameters.width ? | number | - |
Returns
(undefined
| vec2
)[]
Screen space points regadless if they are within the current canvas size or undefined if point is outside screen space.
Defined in
@novorender/web_app/screen_space_conversions.ts:36
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.
Defined in
@novorender/web_app/screen_space_conversions.ts:66
Properties
drawContext
readonly drawContext: DrawContext;