Azimuth/polar limit

Hi,

How would i be able to add an azimuthal max/min that is lets say 45 degrees on both sides relative to the camera’s current rotation?

Something that would fix it i think is resetting the center of the controls to the current rotation.

Thanks in advance,
Axel

Do you mind explaining in more detail why you can use the existing properties minAzimuthAngle, maxAzimuthAngle, minPolarAngle and maxPolarAngle?

Not at all, so assuming the controls’ current azimuth angle is 0 i can apply the min and max from(0-180 degrees if im correct) so you can move half a circle to left and right from the starting point.

My issue is when the controls’ current angle inst 0. for example when the controls angle is at 45 degrees and from that current view i want to add a min and max limit. i tried just adding the current angle to the amount i want to limit the movement but I’m getting weird results

         var start = 45  //current angle
         controls.maxAzimuthAngle = THREE.Math.degToRad(start + 180)
         controls.minAzimuthAngle = THREE.Math.degToRad(start - 180)

I assumed this would work but it doens’t. what i have noticed is that the minAzimuthAngle does work properly but the maxAzimuthAngle doesn’t and i think it is because the angle is over 180 degrees.

Hope this helps, i could also share a link to the project where i’m having this issue if that would help.

Axel