Last active
December 12, 2016 00:43
-
-
Save AndrewRayCode/988ce72f67a56b277dbab8923d928fbc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Build the spiral geometry | |
for( let i = 0; i < lineSteps; i += 1 ) { | |
const position = new Vector3( | |
( -( i / lineSteps ) * lineLength ) + ( lineLength / 2 ), | |
radius * Math.sin( ( i / lineSteps ) * ( Math.PI * 2 * coils ) ), | |
radius * Math.cos( ( i / lineSteps ) * ( Math.PI * 2 * coils ) ), | |
); | |
vertexGeometry.vertices.push( position ); | |
} |
This file contains hidden or 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
// add the bulbs | |
for( let i = 0; i < bulbsPerStrand; i += 1 ) { | |
const position = new Vector3( | |
( -( i / bulbsPerStrand ) * lineLength ) + ( lineLength / 2 ), | |
radius * Math.sin( ( i / bulbsPerStrand ) * ( Math.PI * 2 * coils ) ), | |
radius * Math.cos( ( i / bulbsPerStrand ) * ( Math.PI * 2 * coils ) ), | |
); | |
bulbMesh.position.copy( position ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment