UNPKG

mylingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

14 lines (12 loc) 342 B
import { containerBounds } from "../../engine/renderLoop/renderSetup" export default (clientX: number, clientY: number) => { const rect = containerBounds[0] clientX -= rect.x clientY -= rect.y return [ (clientX / rect.width) * 2 - 1, -(clientY / rect.height) * 2 + 1, clientX, clientY ] }