Aslam khan
Aslam khan

Reputation: 345

How to set limit on horizontal rotation of Orbit Control in Three.js

Actually i have tried to set limit on horizontal rotation of orbit control but i haven't find any solution for limiting it within the given value like it happen in vertical rotation.

Please help me! I would appreciate your effort!

Upvotes: 1

Views: 1116

Answers (1)

MlleBz
MlleBz

Reputation: 341

Check OrbitControls documentation, it is very complete.

For limit horizontal rotation you can add these lines:

controls.maxAzimuthAngle = Math.PI / 2;  
controls.minAzimuthAngle = Math.PI / 4;

Upvotes: 1

Related Questions