Gregg Tavares 5 年之前
父节点
当前提交
c1bef295e2
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      threejs/lessons/threejs-custom-geometry.md
  2. 2 2
      threejs/threejs-custom-geometry-heightmap.html

+ 2 - 2
threejs/lessons/threejs-custom-geometry.md

@@ -410,8 +410,8 @@ We'll then make 4 triangles from those 5 vertices
 
     // add the texture coordinates for each vertex of each face
     const u0 = x / cellsAcross;
-    const v0 = z / cellsAcross;
-    const u1 = (x + 1) / cellsDeep;
+    const v0 = z / cellsDeep;
+    const u1 = (x + 1) / cellsAcross;
     const v1 = (z + 1) / cellsDeep;
     const um = (u0 + u1) / 2;
     const vm = (v0 + v1) / 2;

+ 2 - 2
threejs/threejs-custom-geometry-heightmap.html

@@ -120,8 +120,8 @@ function main() {
 
         // add the texture coordinates for each vertex of each face.
         const u0 = x / cellsAcross;
-        const v0 = z / cellsAcross;
-        const u1 = (x + 1) / cellsDeep;
+        const v0 = z / cellsDeep;
+        const u1 = (x + 1) / cellsAcross;
         const v1 = (z + 1) / cellsDeep;
         const um = (u0 + u1) / 2;
         const vm = (v0 + v1) / 2;