소스 검색

Fixed to procedural generation doc

Juan Linietsky 6 년 전
부모
커밋
47a1427e61
1개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 10 10
      tutorials/content/procedural_geometry.rst

+ 10 - 10
tutorials/content/procedural_geometry.rst

@@ -21,7 +21,7 @@ Here is a simple example of how to use it to add a single triangle.
 
 
     var st = SurfaceTool.new()
     var st = SurfaceTool.new()
     
     
-    st.begin(Mesh::PRIMITIVE_TRIANGLE)
+    st.begin(Mesh.PRIMITIVE_TRIANGLE)
 
 
     # Prepares attributes for add_vertex
     # Prepares attributes for add_vertex
     st.add_normal( Vector3(0,0,1) )
     st.add_normal( Vector3(0,0,1) )
@@ -52,7 +52,7 @@ ImmediateGeometry
 Unlike *SurfaceTool*, :ref:`ImmediateGeometry<class_ImmediateGeometry>` is an actual node. It's similar in the "OpenGL 1.x" style API,
 Unlike *SurfaceTool*, :ref:`ImmediateGeometry<class_ImmediateGeometry>` is an actual node. It's similar in the "OpenGL 1.x" style API,
 but it's actually designed to create content on the fly and modify it every frame efficiently.
 but it's actually designed to create content on the fly and modify it every frame efficiently.
 
 
-Generating complex geometry (several thousand vertices) with this node is inefficient, even if it's done only once. Instead, *ImmediateGeometry* is designed to generate simple geometry every frame.
+Generating complex geometry (several thousand vertices) with this node is inefficient, even if it's done only once. Instead, *ImmediateGeometry* is designed to generate simple geometry that changes every frame.
 
 
 It's used similar to *SurfaceTool*.
 It's used similar to *SurfaceTool*.
 
 
@@ -69,7 +69,7 @@ It's used similar to *SurfaceTool*.
         clear()
         clear()
 
 
         # Begin draw
         # Begin draw
-        begin(Mesh::PRIMITIVE_TRIANGLE)
+        begin(Mesh.PRIMITIVE_TRIANGLE)
     
     
         # Prepares attributes for add_vertex
         # Prepares attributes for add_vertex
         set_normal( Vector3(0,0,1) )
         set_normal( Vector3(0,0,1) )
@@ -100,8 +100,8 @@ Similar code as before, but draw a square using indices:
 .. tabs::
 .. tabs::
  .. code-tab:: gdscript GDScript
  .. code-tab:: gdscript GDScript
 
 
-    var array = []
-    array.resize(Mesh::ARRAY_MAX)
+    var arrays = []
+    arrays.resize(Mesh::ARRAY_MAX)
 
 
     var normal_array = []
     var normal_array = []
     var uv_array = []
     var uv_array = []
@@ -138,13 +138,13 @@ Similar code as before, but draw a square using indices:
     index_array[4]=3
     index_array[4]=3
     index_array[5]=0
     index_array[5]=0
 
 
-    arrays[Mesh::ARRAY_VERTEX]=vertex_array
-    arrays[Mesh::ARRAY_NORMAL]=normal_array
-    arrays[Mesh::ARRAY_TEX_UV]=uv_array
-    arrays[Mesh::ARRAY_INDEX]=index_array
+    arrays[Mesh.ARRAY_VERTEX]=vertex_array
+    arrays[Mesh.ARRAY_NORMAL]=normal_array
+    arrays[Mesh.ARRAY_TEX_UV]=uv_array
+    arrays[Mesh.ARRAY_INDEX]=index_array
 
 
     var mesh = ArrayMesh.new()
     var mesh = ArrayMesh.new()
 
 
-    mesh.add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,arrays)
+    mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES,arrays)