]> git.sesse.net Git - nageru/commitdiff
Visualize the flow consistently with .flo files (which have y = down).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 5 Jul 2018 22:22:24 +0000 (00:22 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 5 Jul 2018 22:22:24 +0000 (00:22 +0200)
flow.cpp

index e59a4812e8e2dcd0a3eef18be621d8b98c1b6c00..205b24f098e4035f9f725a2f16e0c8b493fe6289 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -523,7 +523,7 @@ int main(void)
                        float w = dense_flow[(yy * level_width + x) * 3 + 2];
 
                        du = (du / w) * level_width;
-                       dv = (dv / w) * level_height;
+                       dv = (-dv / w) * level_height;
 
                        uint8_t r, g, b;
                        flow2rgb(du, dv, &r, &g, &b);