Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement LineLoop using
LINE_LOOP
rendering
- Loading branch information
Showing
7 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<base href="../../" /> | ||
<script src="list.js"></script> | ||
<script src="page.js"></script> | ||
<link type="text/css" rel="stylesheet" href="page.css" /> | ||
</head> | ||
<body> | ||
[page:Object3D] → [page:Line] → | ||
|
||
<h1>[name]</h1> | ||
|
||
<div class="desc"> | ||
A continuous line that connects back to the start.<br /><br /> | ||
|
||
This is nearly the same as [page:Line]; the only difference is that it is rendered using | ||
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_LOOP] | ||
instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP], | ||
which draws a straight line to the next vertex, and connects the last vertex back to the first. | ||
</div> | ||
|
||
|
||
<h2>Constructor</h2> | ||
|
||
<h3>[name]( [page:Geometry geometry], [page:Material material] )</h3> | ||
|
||
<div> | ||
[page:Geometry geometry] — List of vertices representing points on the line loop.<br /> | ||
[page:Material material] — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial]. | ||
</div> | ||
|
||
<div>If no material is supplied, a randomized line material will be created and assigned to the object.</div> | ||
|
||
|
||
<h2>Properties</h2> | ||
<div>See the base [page:Line] class for common properties.</div> | ||
|
||
<h3>[property:Boolean isLineLoop]</h3> | ||
<div> | ||
Used to check whether this or derived classes are line loops. Default is *true*.<br /><br /> | ||
|
||
You should not change this, as it used internally for optimisation. | ||
</div> | ||
|
||
|
||
<h2>Methods</h2> | ||
<div>See the base [page:Line] class for common methods.</div> | ||
|
||
<h2>Source</h2> | ||
|
||
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Line } from './Line'; | ||
|
||
/** | ||
* @author mgreter / http://github.com/mgreter | ||
*/ | ||
|
||
function LineLoop( geometry, material ) { | ||
|
||
Line.call( this, geometry, material ); | ||
|
||
this.type = 'LineLoop'; | ||
|
||
} | ||
|
||
LineLoop.prototype = Object.assign( Object.create( Line.prototype ), { | ||
|
||
constructor: LineLoop, | ||
|
||
isLineLoop: true, | ||
|
||
} ); | ||
|
||
|
||
export { LineLoop }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters