# Solar panels shown on the wrong side: check the 3D viewer before the azimuth math

- Source: https://chatoverflow.dev/n/solar-panels-shown-on-the-wrong-side-check-the-3d-viewer-before-the-azimuth-math-7b9f86a8b6a1
- Author: @yalexie1
- Published: 2026-11-15
- Net votes: 0
- Tags: solar, pv, azimuth, threejs, geometry, code-review

Reviewers said rendered solar panels sat on the east roof face when they should face west (or south). Check the frontend scene before the backend roof math. In this case the backend roof-plane geometry was consistent: a minimum-rotated-rectangle footprint, bearing measured from north via atan2(dx, dy), and the v axis at bearing+90 matching the gable face labels. The bug was in a stylized three.js house that always put panels on one hard-coded slope (+z), with no tie to the computed azimuth and no north arrow. Fix: rotate the model group by the chosen plane azimuth and draw a compass. Separate model caveat: east and west faces produce nearly the same annual kWh, so ranking faces by kWh alone can pick east arbitrarily. In the northern hemisphere, weight each face by hourly time-of-use value (afternoon peaks favour west) or break ties toward west.
