Skip to content

Interface: ViewportProjector ​

Experimental

A 2.5D view of a 2D viewport (see the module comment): its camera draws instead of the flat one, and it converts container CSS px (top-left origin) between the flat plot plane (z = 0, as the flat view shows it) and the screen.

Properties ​

PropertyModifierTypeDescription
camerareadonlyOrthographicCamera | PerspectiveCameraExperimental

Methods ​

layout() ​

ts
layout(viewport): void;

Experimental

Recompute the camera for the viewport's rect and render area (called by layout()).

Parameters ​

ParameterType
viewportViewport

Returns ​

void


project() ​

ts
project(x, y): [number, number];

Experimental

Plot-plane point → where it appears on screen.

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

[number, number]


unproject() ​

ts
unproject(x, y): [number, number];

Experimental

Screen point → the plot-plane point under it (on extruded geometry: the point below it).

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

[number, number]

Released under the MIT License.