Set the movers' zeros and pan directions, swap M1/M2's patch, and model tilt in the simulator.

The front right mover is on DMX 1 and the front left on 45, so M1 and M2
swap addresses in the stage map and test.qxw. Measured on the rig, pan 0
faces forward on the front pair and into the middle on the back pair, back
at 85. M1 and M4 turn anticlockwise, so movers get a pan_reverse flag.

Tilt 127 now points straight down: the simulator draws a spot under the
head, and past 127 the beam flips behind the pan heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-22 22:54:14 +13:00
1 parent 2b0f9e2f9b
commit fc8abf9c99
9 files changed
+124 -26

No files matched your search

+32 -3
View File
@@ -293,17 +293,24 @@ function drawGlow(sx, sy, fixture, color) {
function drawBeam(sx, sy, fixture, live, color, fixed) {
const level = (color.r + color.g + color.b) / 255;
const length = fixed ? fixed.beam : Math.max(live.beam_m || 0, fixture.kind === "mover" ? 2.2 : 0);
if (live.patched === false || level <= 0.02 || !length) return;
if (live.patched === false || level <= 0.02) return;
const aim = fixed || aimed(fixture.id, live, fixture.zero);
// Mover reach is signed: below zero the head has tilted past straight down.
const reach = fixed ? fixed.beam : fixture.kind === "mover" ? aim.beam : live.beam_m || 0;
// DMX focus 0 is a wide wash. Focus 255 holds the zoom angle.
// Fixed beams pass spread directly, 0 tight and 1 wide.
const spread = fixed ? fixed.focus : 1 - (live.focus || 0);
const zoom = fixed ? fixed.zoom : live.zoom_deg || 8;
const tight = zoom / 2;
const wide = Math.max(tight, 40);
const rad = aim.pan * Math.PI / 180;
const half = (tight + (wide - tight) * spread) * Math.PI / 180;
if (fixture.kind === "mover" && Math.abs(reach) < SPOT_M) {
drawSpot(sx, sy, fixture, aim.pan, reach, half, color, spread);
return;
}
const length = Math.abs(reach);
if (!length) return;
const rad = (aim.pan + (reach < 0 ? 180 : 0)) * Math.PI / 180;
const tip = [fixture.x + Math.sin(rad) * length, fixture.y + Math.cos(rad) * length];
const left = [fixture.x + Math.sin(rad - half) * length, fixture.y + Math.cos(rad - half) * length];
const right = [fixture.x + Math.sin(rad + half) * length, fixture.y + Math.cos(rad + half) * length];
@@ -320,6 +327,27 @@ function drawBeam(sx, sy, fixture, live, color, fixed) {
ctx.fill();
}
// Below this plan reach a mover is pointing near straight down.
const SPOT_M = 0.5;
// Throw to the floor for the spot under a mover.
const DROP_M = 2.5;
function drawSpot(sx, sy, fixture, pan, reach, half, color, spread) {
const rad = pan * Math.PI / 180;
const cx = sx(fixture.x + Math.sin(rad) * reach);
const cy = sy(fixture.y + Math.cos(rad) * reach);
const radius = Math.max(4, Math.abs(sx(DROP_M * Math.tan(half)) - sx(0)));
const gradient = ctx.createRadialGradient(cx, cy, 0, cx, cy, radius);
const alpha = 0.85 * (1 - spread * 0.35);
gradient.addColorStop(0, `rgba(${color.r},${color.g},${color.b},${alpha})`);
gradient.addColorStop(0.7, `rgba(${color.r},${color.g},${color.b},${alpha * 0.6})`);
gradient.addColorStop(1, `rgba(${color.r},${color.g},${color.b},0)`);
ctx.fillStyle = gradient;
ctx.beginPath();
ctx.arc(cx, cy, radius, 0, Math.PI * 2);
ctx.fill();
}
function lensRotation(live) {
if (live.spin_dps) return ((performance.now() / 1000) * live.spin_dps * Math.PI) / 180;
return ((live.lens_deg || 0) * Math.PI) / 180;
@@ -443,6 +471,7 @@ function updateDetail() {
if (live.reset) bits.push("reset");
if (fixture.kind === "mover" && live.pan_deg != null) {
bits.push(`pan ${live.pan_deg.toFixed(0)}°`);
if (live.tilt_deg != null) bits.push(`tilt ${live.tilt_deg.toFixed(0)}°`);
bits.push(`zoom ${(live.zoom_deg || 0).toFixed(0)}°`);
if (live.spin_dps) bits.push(`lens ${live.spin_dps > 0 ? "CW" : "CCW"}`);
else if (live.lens_deg) bits.push(`lens ${live.lens_deg.toFixed(0)}°`);