I have not found any good tutorials for doing so, I tried to convert and use a Unity-based tutorial but that didn't work out
I would atleast like to know how to place a mesh based on the FastNoiseLite function

  • xyz and Tomcat replied to this.
  • xyz I just made a project with the minimal things, in the minimal project, the triangle displays. It now also displays in the original project.
    The reason why it's suddenly working is because I changed

    	vertices.push_back(Vector3(0, 500, 0))
    	vertices.push_back(Vector3(500, 0, 0))
    	vertices.push_back(Vector3(0, 0, 500))

    back to

    vertices.push_back(Vector3(0, 1, 0))
    	vertices.push_back(Vector3(1, 0, 0))
    	vertices.push_back(Vector3(0, 0, 1))

    Which is weird since I only changed it to 500 when it wouldn't display. Problem solved despite the code change only happening after it wouldn't work initially.

    skatefrog I'd expect plethora of tutorials on this as everybody and their granny is doing procedural terrain generation.

      xyz There are tutorials for 2D procedurally generated terrain, but I'm unsure if/how to use the information they give to create 3D procedurally generated terrain

      • xyz replied to this.

        Tomcat Sorry for the confusion, thank you for trying to help but I'm looking to make procedurally generated terrain. Randomized by a seed

          skatefrog but I'm looking to make procedurally generated terrain. Randomized by a seed

          I'll be extremely interested to see what you come up with. 🐱

          xyz Ok, I'm trying to go by the documentation right now. So this code is supposed to create a triangle, correct?

          var vertices = PackedVector3Array()
          vertices.push_back(Vector3(0, 1, 0))
          vertices.push_back(Vector3(1, 0, 0))
          vertices.push_back(Vector3(0, 0, 1))
          
          # Initialize the ArrayMesh.
          var arr_mesh = ArrayMesh.new()
          var arrays = []
          arrays.resize(Mesh.ARRAY_MAX)
          arrays[Mesh.ARRAY_VERTEX] = vertices
          
          # Create the Mesh.
          arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
          var m = MeshInstance3D.new()
          m.mesh = arr_mesh

          Well I don't see any triangle in game

          • xyz replied to this.

            skatefrog You need to add the mesh instance node to the scene tree if you want it to be rendered.

              xyz The MeshInstance3D yes? I already have that in my scene

              • xyz replied to this.

                skatefrog Well then assign the generated array mesh to that instance. The code you posted creates a new mesh instance node but it doesn't add it to the scene tree.

                  xyz Can you elaborate? I thought I just needed a MeshInstance3D in the scene with the script attached

                  • xyz replied to this.

                    skatefrog Well you need to assign a mesh resource to that instance, so the instance knows what mesh data to instantiate. If the script you posted is attached to a MeshInstance3D node then instead of this:

                    # Create the Mesh.
                    arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
                    var m = MeshInstance3D.new()
                    m.mesh = arr_mesh

                    You'll need to do this:

                    # Assign mesh to the mesh instance
                    arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
                    mesh = arr_mesh

                      xyz I changed it to what you suggested, I still don't see anything

                      • xyz replied to this.

                        skatefrog What do you expect to see? Maybe your camera is not positioned right or the mesh is too small.

                          xyz I'm expecting to see a triangle, as that's what the documentation says will be created with the code.
                          I don't think the issue is my camera, it's not visible in the editor either, and my camera seems fine for everything else.
                          It could be that the mesh is too small but I adjusted the vertices values to be higher and that didn't do anything

                          • xyz replied to this.

                            skatefrog You can't see it in the editor because scripts by default don't run in the editor. Note that the triangle will be visible only from one side due to backface culling. So try playing with the camera position. It may also be obscured by something else in the scene. You provided too little information to properly diagnose the problem. Post the minimal reproduction project if you can.

                              xyz

                              "You can't see it in the editor because scripts by default don't run in the editor"

                              I forgot about that, understood
                              I had no idea about backface culling till now, I just tried experimenting with various positions of the camera. Camera above the MeshInstance3D, below it, to the left, to the right. By posting the minimal reproduction do you mean code or a video demonstration?

                              • xyz replied to this.

                                skatefrog I mean the whole godot project containing only the minimal amount of stuff that's sufficient to demonstrate the problem.

                                  xyz I just made a project with the minimal things, in the minimal project, the triangle displays. It now also displays in the original project.
                                  The reason why it's suddenly working is because I changed

                                  	vertices.push_back(Vector3(0, 500, 0))
                                  	vertices.push_back(Vector3(500, 0, 0))
                                  	vertices.push_back(Vector3(0, 0, 500))

                                  back to

                                  vertices.push_back(Vector3(0, 1, 0))
                                  	vertices.push_back(Vector3(1, 0, 0))
                                  	vertices.push_back(Vector3(0, 0, 1))

                                  Which is weird since I only changed it to 500 when it wouldn't display. Problem solved despite the code change only happening after it wouldn't work initially.