Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Vector3 } from 'three'
- const v = new Vector3()
- export default (v3, camera) => {
- v.copy(v3)
- v.project(camera)
- return {
- x: v.x * window.innerWidth * 0.5 + window.innerWidth * 0.5,
- y: -v.y * window.innerHeight * 0.5 + window.innerHeight * 0.5
- }
- }
Add Comment
Please, Sign In to add comment