Skip to content

Function: toDeviceGLRect() ​

ts
function toDeviceGLRect(rect, canvasCssHeight, pixelRatio, out?): ViewportRect;

Experimental

Convert a CSS rect (top-left origin) to a device-px GL rect (bottom-left origin) the way three.js setViewport/setScissor do: flip against the CSS canvas height, scale by DPR, round.

Parameters ​

ParameterType
rectReadonly<ViewportRect>
canvasCssHeightnumber
pixelRationumber
outViewportRect

Returns ​

ViewportRect

Released under the MIT License.