Answers for "threejs tube shape geometry"

0

threejs tube shape geometry

class CustomSinCurve extends THREE.Curve {
  constructor(scale) {
    super();
    this.scale = scale;
  }
  getPoint(t) {
    const tx = t * 3 - 1.5;
    const ty = Math.sin(2 * Math.PI * t);
    const tz = 0;
    return new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);
  }
}

const path = new CustomSinCurve(4);
const tubularSegments = 20;  
const radius = 1;  
const radialSegments = 8;  
const closed = false;  
const geometry = new THREE.TubeGeometry(
    path, tubularSegments, radius, radialSegments, closed);
Posted by: Guest on May-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language