admin管理员组文章数量:1194114
How can I limit horizontal rotation on OrbitControls?
Inside the code I could see that it's possible to limit it vertically using minPolarAngle
and maxPolarAngle
. But I couldn't find a way to limit it horizontally.
--
Edit: I know that it OrbitControls doesn't rotate the Mesh but the Camera. I just want a solution to put horizontal limits on the camera.
How can I limit horizontal rotation on OrbitControls?
Inside the code I could see that it's possible to limit it vertically using minPolarAngle
and maxPolarAngle
. But I couldn't find a way to limit it horizontally.
--
Edit: I know that it OrbitControls doesn't rotate the Mesh but the Camera. I just want a solution to put horizontal limits on the camera.
Share Improve this question asked Aug 14, 2014 at 13:14 armoucararmoucar 4081 gold badge4 silver badges15 bronze badges1 Answer
Reset to default 29EDIT: The ability to constrain camera movement both horizontally and vertically is a feature of OrbitControls
.
// How far you can orbit vertically, upper and lower limits.
// Range is 0 to Math.PI radians.
this.minPolarAngle = 0; // radians
this.maxPolarAngle = Math.PI; // radians
// How far you can orbit horizontally, upper and lower limits.
// If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI )
this.minAzimuthAngle = - Infinity; // radians
this.maxAzimuthAngle = Infinity; // radians
three.js r.147
本文标签: javascriptLimit OrbitControls horizontal rotationStack Overflow
版权声明:本文标题:javascript - Limit OrbitControls horizontal rotation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738498427a2090122.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论