let targetPosition = object3D.position.clone();
let vec3 = targetPosition.project(camera);
// 视野外
if (vec3.x > -1 && vec3.x < 1 && vec3.y > -1 && vec3.y < 1) {
//...
}
let targetPosition = object3D.position.clone();
let vec3 = targetPosition.project(camera);
// 视野外
if (vec3.x > -1 && vec3.x < 1 && vec3.y > -1 && vec3.y < 1) {
//...
}
本文标题:three.js检测元素是否在视野外
本文链接:https://www.haomeiwen.com/subject/hcxqhqtx.html
网友评论