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();