1
0
mirror of synced 2025-02-17 19:19:19 +01:00

Fix wiggling textures in perspective mode due to premature rounding.

This commit is contained in:
Jennifer Taylor 2021-08-05 17:33:09 +00:00
parent 74838e698d
commit 53f69c0eca

View File

@ -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.