You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Material] &rarr; [page:ShaderMaterial] &rarr;
<h1>[name]</h1>
<p class="desc">
A material for drawing wireframe-style geometries.
Unlike [page:LineBasicMaterial], it supports arbitrary line widths and allows using world units instead of screen space units.
This material is used with [page:LineSegments2] and [page:Line2].
</p>
<p class="desc">
Lines are always rendered with round caps and round joints.
</p>
<h2>Examples</h2>
<p>
[example:webgl_lines_fat WebGL / lines / fat ]<br />
[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]<br />
[example:webgl_lines_fat_wireframe WebGL / lines / fat / wireframe ]<br />
[example:webgpu_lines_fat WebGPU / lines / fat / raycasting ]
</p>
<h2>Constructor</h2>
<h3>[name]( [param:Object parameters] )</h3>
<p>
[page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
Any property of the material (including any property inherited from [page:ShaderMaterial]) can be passed in here.
</p>
<p>
The exception is the property [page:Hexadecimal color], which can be passed in as a number or hexadecimal string and is `0xffffff` (white) by default.
[page:Color.set]( color ) is called internally.
</p>
<h2>Properties</h2>
<p>See the base [page:ShaderMaterial] class for common properties.</p>
<h3>[property:Color color]</h3>
<p>[page:Color] of the material, by default set to white (0xffffff).</p>
<h3>[property:Boolean dashed]</h3>
<p>Whether the line is dashed, or solid. Default is `false`.</p>
<h3>[property:number dashOffset]</h3>
<p>Where in the dash cycle the dash starts. Default is `0`.</p>
<h3>[property:number dashScale]</h3>
<p>The scale of the dashes and gaps. Default is `1`.</p>
<h3>[property:number dashSize]</h3>
<p>The size of the dash. Default is `1`.</p>
<h3>[property:number gapSize]</h3>
<p>The size of the gap. Default is `1`.</p>
<h3>[property:Float linewidth]</h3>
<p>Controls line thickness in CSS pixel units when [page:worldUnits] is `false` (default), or in world units when [page:worldUnits] is `true`. Default is `1`.</p>
<h3>[property:Vector2 resolution]</h3>
<p>
The size of the viewport, in screen pixels.
This must be kept updated to make screen-space rendering accurate.
The [page:LineSegments2.onBeforeRender] callback performs the update for visible objects.
Default is `[1, 1]`.
</p>
<h3>[property:Boolean worldUnits]</h3>
<p>
Whether the material's sizes (width, dash gaps) are in world units.
Default is `false` (screen space units.)
</p>
<h2>Methods</h2>
<p>See the base [page:ShaderMaterial] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineMaterial.js examples/jsm/lines/LineMaterial.js]
</p>
</body>
</html>