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 | |
| color | Line 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
| material | Target to copy into. Default: a new LineMaterial. |
Returns
| type | description |
|---|---|
| LineMaterial |
getColor()
Returns
| type | description |
|---|---|
| Color | A copy of the line color. |
setColor(c)
Parameters
| c* | Line color. Copied into the existing Color. |
* Required
getOpacity()
Returns
| type | description |
|---|---|
| number | Line opacity in [0, 1]. |
setOpacity(o)
Parameters
| o* number | Line opacity in [0, 1]. Requires setTransparent(true) for < 1. |
* Required
getVertexColors()
Returns
| type | description |
|---|---|
| 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
| type | description |
|---|---|
| boolean | Whether to write to the depth buffer. |
setDepthWrite(v)
Parameters
| v* boolean | Whether to write to the depth buffer. |
* Required
getDepthTest()
Returns
| type | description |
|---|---|
| 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
| type | description |
|---|---|
| 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