Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lock x axis rotation when using OrbitControls - Three.js

Is it feasible to lock the x axis rotation when using OrbitControls? Currently I have an object model of a christmas star hung on a string. I want it to rotate only horizontally.

like image 994
Safal Pillai Avatar asked Dec 07 '22 20:12

Safal Pillai


1 Answers

For your OrbitControls instance set

controls.minPolarAngle = Math.PI/2;
controls.maxPolarAngle = Math.PI/2;
like image 181
prisoner849 Avatar answered Dec 30 '22 20:12

prisoner849