From 53f69c0eca57ad5974f5a49c48bd2a577b29363e Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Thu, 5 Aug 2021 17:33:09 +0000 Subject: [PATCH] Fix wiggling textures in perspective mode due to premature rounding. --- bemani/format/afp/blend/perspective.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bemani/format/afp/blend/perspective.py b/bemani/format/afp/blend/perspective.py index 65dd1a1..a0aef33 100644 --- a/bemani/format/afp/blend/perspective.py +++ b/bemani/format/afp/blend/perspective.py @@ -29,15 +29,15 @@ def perspective_calculate( ]: imgloc = transform.multiply_point(Point(texx, texy)) distance = imgloc.z - camera.z - imgx = int(((imgloc.x - camera.x) * (focal_length / distance)) + camera.x) - imgy = int(((imgloc.y - camera.y) * (focal_length / distance)) + camera.y) + imgx = ((imgloc.x - camera.x) * (focal_length / distance)) + camera.x + imgy = ((imgloc.y - camera.y) * (focal_length / distance)) + camera.y xy_point = Point(imgx, imgy) xy.append(xy_point) uvz[xy_point] = Point( - focal_length * texx / distance, - focal_length * texy / distance, - focal_length / distance, + texx / distance, + texy / distance, + 1 / distance, ) # Calculate the maximum range of update this texture can possibly reside in.