Request

Response

    Autodesk.Viewing.Scene
    Version 8 preview
    This page documents a preview of the Viewer SDK v8. APIs and content can still change before the final release.

    LineMaterial

    Unlit material for 3D line geometry.

    Use with geometry whose index buffer contains consecutive vertex-index pairs (each pair defines one line segment). Lines are always 1 px wide.

    new LineMaterial(params)

    Parameters

    Expand all
    params
    object
    colorLine color. Default: white.
    opacity
    number
    Line opacity in [0, 1]. Default: 1.
    vertexColors
    boolean
    Use per-vertex colors stored in the geometry. Default: false.
    depthWrite
    boolean
    Write to the depth buffer. Default: true.
    depthTest
    boolean
    Depth-test against the depth buffer. Default: true.
    transparent
    boolean
    Render in the transparent pass with alpha blending. Default: false.

    Methods

    clone(material)

    Parameters

    materialTarget to copy into. Default: a new LineMaterial.

    Returns

    typedescription
    LineMaterial

    getColor()

    Returns

    typedescription
    Color A copy of the line color.

    setColor(c)

    Parameters

    c*Line color. Copied into the existing Color.
    * Required

    getOpacity()

    Returns

    typedescription
    number Line opacity in [0, 1].

    setOpacity(o)

    Parameters

    o*
    number
    Line opacity in [0, 1]. Requires setTransparent(true) for < 1.
    * Required

    getVertexColors()

    Returns

    typedescription
    boolean Whether to use per-vertex colors from the geometry’s color attribute.

    setVertexColors(v)

    Parameters

    v*
    boolean
    Whether to use per-vertex colors.
    * Required

    getDepthWrite()

    Returns

    typedescription
    boolean Whether to write to the depth buffer.

    setDepthWrite(v)

    Parameters

    v*
    boolean
    Whether to write to the depth buffer.
    * Required

    getDepthTest()

    Returns

    typedescription
    boolean Whether to depth-test against the depth buffer.

    setDepthTest(v)

    Parameters

    v*
    boolean
    Whether to depth-test against the depth buffer.
    * Required

    getTransparent()

    Returns

    typedescription
    boolean Whether the material renders in the transparent pass.

    setTransparent(v)

    Parameters

    v*
    boolean
    Whether the material renders in the transparent pass with alpha blending.
    * Required