Three.JS 从世界坐标系转换到屏幕坐标系

 1 var projector = new THREE.Projector();  
 2   
 3 var world_vector = new THREE.Vector3(0,0,1);  
 4   
 5 var vector = projector.projectVector(world_vector, camera);  
 6   
 7 var halfWidth = window.innerWidth / 2;  
 8 var halfHeight = window.innerHeight / 2;  
 9   
10 var result = {  
11   
12     x: Math.round(vector.x * halfWidth + halfWidth),  
13     y: Math.round(-vector.y * halfHeight + halfHeight)  
14   
15 };  
原文地址:https://www.cnblogs.com/front-end-1149980941/p/6251708.html