SHARE
TWEET

Untitled

a guest Jan 21st, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Vector3 } from 'three'
  2.  
  3. const v = new Vector3()
  4.  
  5. export default (v3, camera) => {
  6.   v.copy(v3)
  7.   v.project(camera)
  8.  
  9.   return {
  10.     x: v.x * window.innerWidth * 0.5 + window.innerWidth * 0.5,
  11.     y: -v.y * window.innerHeight * 0.5 + window.innerHeight * 0.5
  12.   }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top