I have a 3D object with the position(x,y,z). How can I calculate the screen position(x,y) of that object?
I have search for it and one solution is that I have to fin
For me this function works (Three.js version 69):
function createVector(x, y, z, camera, width, height) { var p = new THREE.Vector3(x, y, z); var vector = p.project(camera); vector.x = (vector.x + 1) / 2 * width; vector.y = -(vector.y - 1) / 2 * height; return vector; }