shithub: 3d

Download patch

ref: 13a97ea9716bf0c7fa516ffa4adc3b119b964e7b
parent: 8e4e30ec8affd697702c22ac2d29d10ac7fe4133
author: qwx <[email protected]>
date: Fri Mar 12 06:44:05 EST 2021

wrong sign

still works like ass of course

--- a/3d04.c
+++ b/3d04.c
@@ -137,9 +137,9 @@
 	/* offset view */
 	pl.x = 300;
 	/* 50: length of the wall (euclidean distance) */
-	top.min.x = 50/2 * (double)rwl.min.x / rwl.min.y;
+	top.min.x = -50/2 * (double)rwl.min.x / rwl.min.y;
 	top.min.y = (double)top.min.x / rwl.min.y;
-	top.max.x = 50/2 * (double)rwl.max.x / rwl.max.y;
+	top.max.x = -50/2 * (double)rwl.max.x / rwl.max.y;
 	top.max.y = (double)top.min.x / rwl.max.y;
 	r = rectaddpt(top, Pt(pl.x, pl.y));
 	line(fb, r.min, r.max, 0, 0, 1, col[Cwall], ZP);
--- a/3d05.c
+++ b/3d05.c
@@ -140,8 +140,8 @@
 	if(rwl.max.y == 0)
 		rwl.max.y = 1;
 	/* length of the wall = 50 (euclidean distance), we divide for smaller viewsize */
-	top.min.x = 50 + (double)rwl.min.x * 50/2 / rwl.min.y;
-	top.max.x = 50 + (double)rwl.max.x * 50/2 / rwl.max.y;
+	top.min.x = 50 - (double)rwl.min.x * 50/2 / rwl.min.y;
+	top.max.x = 50 - (double)rwl.max.x * 50/2 / rwl.max.y;
 	top.min.y = 50 + -50 / (double)rwl.min.y;
 	top.max.y = 50 + -50 / (double)rwl.max.y;
 	bottom.min.x = top.min.x;