浏览代码

vertex_array Vector3 correction (#2511)

`vertex_array` is defined as a Vector3, but it only contains 2 elements (I assume this was a mistake). So I have added the third element (being 0) to complete the size (i.e. make it a 3-component vector). These vertex vectors should now define the coordinates of a triangle in 3D space.
tree786 6 年之前
父节点
当前提交
3791d83a0b
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      tutorials/content/procedural_geometry.rst

+ 4 - 4
tutorials/content/procedural_geometry.rst

@@ -111,19 +111,19 @@ Similar code as before, but draw a square using indices:
 
 
     normal_array[0] = Vector3(0, 0, 1)
     normal_array[0] = Vector3(0, 0, 1)
     uv_array[0] = Vector2(0, 0)
     uv_array[0] = Vector2(0, 0)
-    vertex_array[0] = Vector3(-1, -1)
+    vertex_array[0] = Vector3(-1, -1, 0)
 
 
     normal_array[1] = Vector3(0, 0, 1)
     normal_array[1] = Vector3(0, 0, 1)
     uv_array[1] = Vector2(0,1)
     uv_array[1] = Vector2(0,1)
-    vertex_array[1] = Vector3(-1, 1)
+    vertex_array[1] = Vector3(-1, 1, 0)
 
 
     normal_array[2] = Vector3(0, 0, 1)
     normal_array[2] = Vector3(0, 0, 1)
     uv_array[2] = Vector2(1, 1)
     uv_array[2] = Vector2(1, 1)
-    vertex_array[2] = Vector3(1, 1)
+    vertex_array[2] = Vector3(1, 1, 0)
 
 
     normal_array[3] = Vector3(0, 0, 1)
     normal_array[3] = Vector3(0, 0, 1)
     uv_array[3] = Vector2(1, 0)
     uv_array[3] = Vector2(1, 0)
-    vertex_array[3] = Vector3(1, -1)
+    vertex_array[3] = Vector3(1, -1, 0)
 
 
     # Indices are optional in Godot, but if they exist they are used.
     # Indices are optional in Godot, but if they exist they are used.
     index_array[0] = 0
     index_array[0] = 0