build/module/lib/geometries/CylinderGeometry.js
/**
 * @param height The vector in the height direction. The length also gives the cylinder length.
 * @param radius The vector in the radius direction. The length also gives the cylinder radius.
 * @param clockwise
 * @param stress
 * @param tilt
 * @param offset
 * @param angle
 * @param generator
 * @param heightSegments
 * @param thetaSegments
 * @param points
 * @param tangents
 * @param vertices
 * @param uvs
 * @hidden
 */
@param height The vector in the height direction. The length also gives the cylinder length.
@param radius The vector in the radius direction. The length also gives the cylinder radius.
@param height The vector in the height direction . The length also gives the cylinder length . @param radius The vector in the radius direction . The length also gives the cylinder radius .
function computeWallVertices(height, radius, clockwise, stress, tilt, offset, angle, generator, heightSegments, thetaSegments, points, tangents, vertices, uvs) {
    var halfHeight = Vector3.copy(height).scale(0.5);
    var stepH = Vector3.copy(height).scale(1 / heightSegments);
    var iLength = heightSegments + 1;
    for (var i = 0; i < iLength; i++) {
        var dispH = Vector3.copy(stepH).scale(i).sub(halfHeight);
        var verticesRow = [];
        var uvsRow = [];
        var v = (heightSegments - i) / heightSegments;
        var arcPoints = arc3(radius, angle, generator, thetaSegments);
        var jLength = arcPoints.length;
        for (var j = 0; j < jLength; j++) {
            var point = arcPoints[j];
            var tangent = Spinor3.dual(point, true);
            point.add(dispH);
            point.stress(stress);
            point.rotate(tilt);
            point.add(offset);
            tangent.stress(stress);
            tangent.rotate(tilt);
            var u = j / thetaSegments;
            points.push(point);
            tangents.push(tangent);
            verticesRow.push(points.length - 1);
            uvsRow.push(new Vector2([u, v]));
        }
        vertices.push(verticesRow);
        uvs.push(uvsRow);
    }
}
function computeWallVertices ( height , radius , clockwise , stress , tilt , offset , angle , generator , heightSegments , thetaSegments , points , tangents , vertices , uvs ) { var halfHeight = Vector3 . copy ( height ) . scale ( 0.5 ) ; var stepH = Vector3 . copy ( height ) . scale ( 1 / heightSegments ) ; var iLength = heightSegments + 1 ; for ( var i = 0 ; i < iLength ; i ++ ) { var dispH = Vector3 . copy ( stepH ) . scale ( i ) . sub ( halfHeight ) ; var verticesRow = [ ] ; var uvsRow = [ ] ; var v = ( heightSegments - i ) / heightSegments ; var arcPoints = arc3 ( radius , angle , generator , thetaSegments ) ; var jLength = arcPoints . length ; for ( var j = 0 ; j < jLength ; j ++ ) { var point = arcPoints [ j ] ; var tangent = Spinor3 . dual ( point , true ) ; point . add ( dispH ) ; point . stress ( stress ) ; point . rotate ( tilt ) ; point . add ( offset ) ; tangent . stress ( stress ) ; tangent . rotate ( tilt ) ; var u = j / thetaSegments ; points . push ( point ) ; tangents . push ( tangent ) ; verticesRow . push ( points . length - 1 ) ; uvsRow . push ( new Vector2 ( [ u , v ] ) ) ; } vertices . push ( verticesRow ) ; uvs . push ( uvsRow ) ; } }
@param height The vector in the height direction.
@param height The vector in the height direction .
/**
     *
     */ /**
     * A displacement in the direction of axis that we must move for each height step.
     */ /**
         * The displacement to the current level.
         */ /**
         * The texture coordinate in the north-south direction.
         */ /**
         * arcPoints.length => thetaSegments + 1
         */ /**
         * j < arcPoints.length => j <= thetaSegments
         */ // Starting with a point on the wall of the regular cylinder... // Compute the tangent bivector before moving the point up the wall, it need not be normalized. // Add the displacement up the wall to get the point to the correct height. // Subject the point to the stress, tilt, offset transformations. // Subject the tangent bivector to the stress and tilt (no need for offset). /**
             * u will vary from 0 to 1, because j goes from 0 to thetaSegments
             */