API

Function CreateLineSystem

  • Creates a line system mesh. A line system is a pool of many lines gathered in a single mesh

    • A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter
    • Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function
    • The parameter lines is an array of lines, each line being an array of successive Vector3
    • The optional parameter instance is an instance of an existing LineSystem object to be updated with the passed lines parameter
    • The optional parameter colors is an array of line colors, each line colors being an array of successive Color4, one per line point
    • The optional parameter useVertexAlpha is to be set to false (default true) when you don't need the alpha blending (faster)
    • The optional parameter material is the material to use to draw the lines if provided. If not, a default material will be created
    • Updating a simple Line mesh, you just need to update every line in the lines array : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines
    • When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines
    • The mesh can be set to updatable with the boolean parameter updatable (default false) if its internal geometry is supposed to change once created

    Parameters

    • name: string

      defines the name of the new line system

    • options: {
          colors?: Nullable<Color4[][]>;
          instance?: Nullable<LinesMesh>;
          lines: Vector3[][];
          material?: Material;
          updatable?: boolean;
          useVertexAlpha?: boolean;
      }

      defines the options used to create the line system

    • scene: Nullable<Scene> = null

      defines the hosting scene

    Returns LinesMesh

    a new line system mesh