问题
I have added sphere to the scene and also some plane geometry to the scene when i zoom in I want the plane geometry look smaller and when i zoom out the plane geometry should appear bigger I don't know how to solve this problem can someone please help me with this problem.
回答1:
Yes! You should animate the camera in this case.
I'm assuming your objects are in the middle at 0, 0, 0.
var zoomingIn = true;
function render() {
if (zoomingIn && camera.position.z > 10) {
camera.position.z -= 0.1;
} else if (!zoomingIn && camera.position.z < 100) {
camera.position.z += 0.1;
}
requestAnimationFrame( render );
renderer.render(scene, camera);
}
render();
来源:https://stackoverflow.com/questions/41852655/zoom-in-and-zoom-out-threejs