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
| Property | Modifier | Type | Description |
|---|---|---|---|
camera | readonly | OrthographicCamera | PerspectiveCamera | Experimental |
Methods
layout()
ts
layout(viewport): void;Experimental
Recompute the camera for the viewport's rect and render area (called by layout()).
Parameters
| Parameter | Type |
|---|---|
viewport | Viewport |
Returns
void
project()
ts
project(x, y): [number, number];Experimental
Plot-plane point → where it appears on screen.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
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
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
[number, number]