Created
September 22, 2019 15:48
-
-
Save erikparr/def26339c788edeffb1915c7c7bee54a to your computer and use it in GitHub Desktop.
Formation of trails / ribbons that follow 3d shapes -- Three.js + WebARonARKit
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
function NurbsRibbonGroup() { | |
this.ribbons = []; | |
this.RIBBONCOUNT = 17; | |
this.ribbonGroup = new THREE.Group(); | |
this.isInited = false; | |
scene.add(this.ribbonGroup); | |
} | |
NurbsRibbonGroup.prototype.init = function(strokeTexture) { | |
console.log("strokeTexture.length: " + strokeTexture.length ); | |
for (var i = 0; i < this.RIBBONCOUNT; i++) { | |
this.ribbons.push(new NurbsRibbon(this)); | |
this.ribbons[i].init(strokeTexture[i%(strokeTexture.length)]); | |
this.ribbonGroup.add(this.ribbons[i].lineGroup); | |
this.isInited= true; | |
} | |
}; | |
NurbsRibbonGroup.prototype.TriggerDrawCurvesFromData = function() { | |
for (var i = 0; i < this.RIBBONCOUNT; i++) { | |
this.ribbons[i].drawLoadedCurve = !this.ribbons[i].drawLoadedCurve; | |
} | |
}; | |
NurbsRibbonGroup.prototype.update = function() { | |
for (var i = 0; i < this.RIBBONCOUNT; i++) { | |
this.ribbons[i].update(); | |
} | |
}; | |
//NurbsRibbonGroup.prototype = Object.create(NurbsRibbon.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment