Guest User

Untitled

a guest
Jan 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment