javascript - How to rotate THREE.TubeGeometry segments? -
i've created flat three.tubegeometry radiussegments = 2, when added scene perpendicular ground:
is possible rotate each tube segment parallel ground?
var points = []; (var = 0; < 5; i++) { var randomy = i*5/2*10 + -50; var randomx = 15*math.sin(5*i); points.push(new three.vector3(randomx, randomy, 0)); } var tubegeometry = new three.tubegeometry(new three.splinecurve3(points), 64, 6, 2, false); tubemesh = createmesh(tubegeometry); scene.add(tubemesh);
my recommendation use custom flat geometry (not tubegeometry!) , calculate vertices want them (not rotate!).
methodology geometry like:
- create random points (here math needed in order have them want them be, funny part!)
- get spline points each curve
- triangulate on them
if decide go forward code here change have parallel plane. add generatetube function, after tubemesh creation:
tubemesh.rotatey(math.pi/2);
Comments
Post a Comment