How to use the LatheGeometry function from three
Find comprehensive JavaScript three.LatheGeometry code examples handpicked from public code repositorys.
GitHub: sarahforcier/LSystems
![sarahforcier profile picture](/sarahforcier.png?size=40)
139 140 141 142 143 144 145 146 147
//Scoot the turtle forward by len units this.moveForward(len/2); }; makeFlower(scale) { var geometry = new THREE.LatheGeometry(points); geometry.scale(0.05, 0.05, 0.05); var material = new THREE.MeshLambertMaterial( {color: 0xcccccc, emissive: this.flower_color} ); var flower = new THREE.Mesh( geometry, material );
55 56 57 58 59 60 61 62 63 64
} function cut(color, reverse) { lastEdgeSkip = edgeSkip; edgeSkip = 1; if(reverse) points.reverse(); var lathedGeom = new THREE.LatheGeometry( points, perimeterSegments, Math.PI * 1.5 + (slightTurn ? Math.PI / perimeterSegments : 0)); if(reverse) points.reverse(); colorVertices(lathedGeom, color || colorGray); var tempPoint = getLastPoint(); points.length = 0;
16 17 18 19 20 21 22 23 24 25
var segments = this.get('segments'); var phiStart = this.get('phiStart'); var phiLength = this.get('phiLength'); // cached geomentry var geo = new t.LatheGeometry(points, segments, phiStart, phiLength); this.set('geo', geo); this.set('mesh', new t.Mesh(geo)); }
three.Vector3 is the most popular function in three (22341 examples)