pan fix
This commit is contained in:
1 parent
0e22ca0e96
commit
319af9bb43
1 file changed
+2
-11
@@ -422,16 +422,7 @@ class LowPassFilter:
|
||||
|
||||
|
||||
def calculate_pan(x_m: float, z_m: float, ceiling_mode: bool = False) -> int:
|
||||
"""Berechnet den Pan-DMX-Wert (0-255) basierend auf 3D-Koordinaten.
|
||||
|
||||
Args:
|
||||
x_m: X-Position in Metern (+X = rechts).
|
||||
z_m: Z-Position (Tiefe) in Metern (+Z = vorne).
|
||||
ceiling_mode: True bei hängender Deckenmontage.
|
||||
|
||||
Returns:
|
||||
Pan-DMX-Wert (0-255).
|
||||
"""
|
||||
"""Berechnet den Pan-DMX-Wert (0-255) basierend auf 3D-Koordinaten."""
|
||||
dx = x_m - OFFSET_X
|
||||
dz = max(0.20, z_m - OFFSET_Z)
|
||||
|
||||
@@ -439,7 +430,7 @@ def calculate_pan(x_m: float, z_m: float, ceiling_mode: bool = False) -> int:
|
||||
pan_deg = math.degrees(pan_rad)
|
||||
|
||||
pan_dmx = 127.5 + (pan_deg / (PAN_RANGE_DEG / 2.0)) * 127.5
|
||||
if ceiling_mode:
|
||||
if not ceiling_mode:
|
||||
pan_dmx = 255.0 - pan_dmx
|
||||
|
||||
return round(max(0.0, min(255.0, pan_dmx)))
|
||||
|
||||
Reference in new issue
Block a user