r3660 - trunk/tools/ImgToMap/src/imgtomap

savagex at icculus.org savagex at icculus.org
Sat May 24 15:55:23 EDT 2008


Author: savagex
Date: 2008-05-24 15:55:22 -0400 (Sat, 24 May 2008)
New Revision: 3660

Modified:
   trunk/tools/ImgToMap/src/imgtomap/MapWriter.java
Log:
round z values down to integer values

Modified: trunk/tools/ImgToMap/src/imgtomap/MapWriter.java
===================================================================
--- trunk/tools/ImgToMap/src/imgtomap/MapWriter.java	2008-05-24 17:38:37 UTC (rev 3659)
+++ trunk/tools/ImgToMap/src/imgtomap/MapWriter.java	2008-05-24 19:55:22 UTC (rev 3660)
@@ -167,10 +167,10 @@
                     /// delta b - c
                     double grad2 = Math.abs(height[x + 1][y] - height[x][y + 1]);
 
-                    Vector3D a = new Vector3D(x * units, -y * units, height[x][y] * max);
-                    Vector3D b = new Vector3D((x + 1) * units, -y * units, height[x + 1][y] * max);
-                    Vector3D c = new Vector3D(x * units, -(y + 1) * units, height[x][y + 1] * max);
-                    Vector3D d = new Vector3D((x + 1) * units, -(y + 1) * units, height[x + 1][y + 1] * max);
+                    Vector3D a = new Vector3D(x * units, -y * units, Math.floor(height[x][y] * max));
+                    Vector3D b = new Vector3D((x + 1) * units, -y * units, Math.floor(height[x + 1][y] * max));
+                    Vector3D c = new Vector3D(x * units, -(y + 1) * units, Math.floor(height[x][y + 1] * max));
+                    Vector3D d = new Vector3D((x + 1) * units, -(y + 1) * units, Math.floor(height[x + 1][y + 1] * max));
                     //Vector3D e = new Vector3D(x * units, -y * units, -16.0);
                     Vector3D f = new Vector3D((x + 1) * units, -y * units, -16.0);
                     Vector3D g = new Vector3D(x * units, -(y + 1) * units, -16.0);




More information about the nexuiz-commits mailing list