extends MeshInstance3D var mat: StandardMaterial3D var ang: float = 0.0 # Called when the node enters the scene tree for the first time. func _ready(): mat = StandardMaterial3D.new() mat.albedo_color = Color(0, 1, 0, 0.5) mat.cull_mode = BaseMaterial3D.CULL_DISABLED mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED mesh = ImmediateMesh.new() func _process(delta): var x0: float = 0.0 var y0: float var z0: float var h: float = 5.0 mesh.clear_surfaces() mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES, mat) mesh.surface_set_color(Color.WHITE) y0 = h * sin(deg_to_rad(ang)) z0 = 10.0 for i in range(1, 20, 1): var y1 = h * sin(deg_to_rad(ang + 10 * i)) var z1 = z0 - 1.5 mesh.surface_add_vertex(Vector3(x0, y1, z1)) mesh.surface_add_vertex(Vector3(x0 + 1, y0, z0)) mesh.surface_add_vertex(Vector3(x0 - 1, y0, z0)) y0 = y1 z0 = z1 mesh.surface_end() ang += 120.0 * delta if ang >= 360.0: ang -= 360.0