admin管理员组文章数量:1425997
I am working on this codesandbox to do practice with React Three Fiber.
My question with the demo is that i do not really understand how i can set the initial zoom way wider in OrbitControls
in order that i can see more small stars?
This is the relevant code where i think i need to pass the zoom values
<OrbitControls
enableZoom={true}
enablePan={true}
enableRotate={true}
/>
I was digging in the official website to understand what is actually needed for OrbitControls
to configure the initial zoom
I am working on this codesandbox to do practice with React Three Fiber.
My question with the demo is that i do not really understand how i can set the initial zoom way wider in OrbitControls
in order that i can see more small stars?
This is the relevant code where i think i need to pass the zoom values
<OrbitControls
enableZoom={true}
enablePan={true}
enableRotate={true}
/>
I was digging in the official website to understand what is actually needed for OrbitControls
to configure the initial zoom
1 Answer
Reset to default 6 +50You can set the camera's initial position further away. In three.js you would do:
camera.position.set(x, y, z); // The point where you want the camera
controls.update();
Seems to work in this demo as well. Try e.g. moving away on the x axis:
<PerspectiveCamera
makeDefault
position={[500, 0.9, 1.8]}
fov={60}
zoom={0.9}
/>
See sandbox fork.
本文标签: javascriptReact Three Fiber OrbitControls Initial zoom widerStack Overflow
版权声明:本文标题:javascript - React Three Fiber OrbitControls Initial zoom wider - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745406509a2657274.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论