diff --git a/tracker-native/src/frame_pipeline.cpp b/tracker-native/src/frame_pipeline.cpp index ae8f862..85890f7 100644 --- a/tracker-native/src/frame_pipeline.cpp +++ b/tracker-native/src/frame_pipeline.cpp @@ -23,7 +23,8 @@ MappingConfig make_mapping_config(const PipelineConfig& c) { m.depth_height = static_cast(c.depth_height); m.z0_meters = 2.5f; m.depth_gain = 1.0f; - m.mirror = true; + m.mirror = false; // the camera frame is mirrored at the source (win_main), so + // landmarks are already mirror-space; don't flip again here. return m; } diff --git a/tracker-native/src/win_main.cpp b/tracker-native/src/win_main.cpp index 298ca2c..d1a4a44 100644 --- a/tracker-native/src/win_main.cpp +++ b/tracker-native/src/win_main.cpp @@ -148,6 +148,18 @@ void WorkerLoop(std::wstring symlink, int req_w, int req_h) { if (!camera.read_frame(bgra, w, h)) { continue; } + // Mirror horizontally at the source so the preview and the published + // depth/color/skeleton all read like a mirror (the mapper's own mirror is + // off; everything downstream sees mirror-space pixels). + for (int y = 0; y < h; ++y) { + uint32_t* row = reinterpret_cast(bgra.data()) + + static_cast(y) * w; + for (int xl = 0, xr = w - 1; xl < xr; ++xl, --xr) { + const uint32_t t = row[xl]; + row[xl] = row[xr]; + row[xr] = t; + } + } rgb.resize(static_cast(w) * h * 3); for (size_t i = 0; i < static_cast(w) * h; ++i) { rgb[i * 3 + 0] = bgra[i * 4 + 2];