Skip to content

Instantly share code, notes, and snippets.

<!--
/*
* Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@erikparr
erikparr / WebXR_Shoe_RibbonGroup.js
Created September 22, 2019 15:48
Formation of trails / ribbons that follow 3d shapes -- Three.js + WebARonARKit
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 );
function NurbsRibbon(strokeTexture) {
this.loadedCurvePts = [];
this.nurbsKnots = [];
this.nurbsDegree = 3;
this.nurbsControlPoints = [];
this.resolution = 100;
this.drawSpeed = 50;
this.spline;
this.segmentPoints;
this.numCtrlPts = 5;