simplify mapping from normalized device coordinates

This commit is contained in:
2026-02-15 20:53:48 +01:00
parent be7dcf8ae5
commit 450ed7042e
2 changed files with 7 additions and 8 deletions

View File

@ -202,8 +202,7 @@ auto manual_transform(Edge2Set &result, const Edge3Set &edges,
};
auto map = [&](const Vector2 &a) -> Vector2 {
return Vector2((a.x + 1.0) / 2.0 * WIDTH,
(1.0 - (a.y + 1.0)) / 2.0 * HEIGHT + HEIGHT / 2.0);
return Vector2((1.0 + a.x) / 2.0 * WIDTH, (1.0 - a.y) * HEIGHT / 2.0);
};
#ifdef PARALLEL_TRANSFORM