dist/claygl.es.js
function() {

        var planes = {
            'px': createPlane('px', this.depthSegments, this.heightSegments),
            'nx': createPlane('nx', this.depthSegments, this.heightSegments),
            'py': createPlane('py', this.widthSegments, this.depthSegments),
            'ny': createPlane('ny', this.widthSegments, this.depthSegments),
            'pz': createPlane('pz', this.widthSegments, this.heightSegments),
            'nz': createPlane('nz', this.widthSegments, this.heightSegments),
        };

        var attrList = ['position', 'texcoord0', 'normal'];
        var vertexNumber = 0;
        var faceNumber = 0;
        for (var pos in planes) {
            vertexNumber += planes[pos].vertexCount;
            faceNumber += planes[pos].indices.length;
        }
        for (var k = 0; k < attrList.length; k++) {
            this.attributes[attrList[k]].init(vertexNumber);
        }
        this.indices = new vendor.Uint16Array(faceNumber);
        var faceOffset = 0;
        var vertexOffset = 0;
        for (var pos in planes) {
            var plane = planes[pos];
            for (var k = 0; k < attrList.length; k++) {
                var attrName = attrList[k];
                var attrArray = plane.attributes[attrName].value;
                var attrSize = plane.attributes[attrName].size;
                var isNormal = attrName === 'normal';
                for (var i = 0; i < attrArray.length; i++) {
                    var value = attrArray[i];
                    if (this.inside && isNormal) {
                        value = -value;
                    }
                    this.attributes[attrName].value[i + attrSize * vertexOffset] = value;
                }
            }
            var len = plane.indices.length;
            for (var i = 0; i < plane.indices.length; i++) {
                this.indices[i + faceOffset] = vertexOffset + plane.indices[this.inside ? (len - i - 1) : i];
            }
            faceOffset += plane.indices.length;
            vertexOffset += plane.vertexCount;
        }

        this.boundingBox = new BoundingBox();
        this.boundingBox.max.set(1, 1, 1);
        this.boundingBox.min.set(-1, -1, -1);
    }
function() {

        var planes = {
            'px': createPlane('px', this.depthSegments, this.heightSegments),
            'nx': createPlane('nx', this.depthSegments, this.heightSegments),
            'py': createPlane('py', this.widthSegments, this.depthSegments),
            'ny': createPlane('ny', this.widthSegments, this.depthSegments),
            'pz': createPlane('pz', this.widthSegments, this.heightSegments),
            'nz': createPlane('nz', this.widthSegments, this.heightSegments),
        };

        var attrList = ['position', 'texcoord0', 'normal'];
        var vertexNumber = 0;
        var faceNumber = 0;
        for (var pos in planes) {
            vertexNumber += planes[pos].vertexCount;
            faceNumber += planes[pos].indices.length;
        }
        for (var k = 0; k < attrList.length; k++) {
            this.attributes[attrList[k]].init(vertexNumber);
        }
        this.indices = new vendor.Uint16Array(faceNumber);
        var faceOffset = 0;
        var vertexOffset = 0;
        for (var pos in planes) {
            var plane = planes[pos];
            for (var k = 0; k < attrList.length; k++) {
                var attrName = attrList[k];
                var attrArray = plane.attributes[attrName].value;
                var attrSize = plane.attributes[attrName].size;
                var isNormal = attrName === 'normal';
                for (var i = 0; i < attrArray.length; i++) {
                    var value = attrArray[i];
                    if (this.inside && isNormal) {
                        value = -value;
                    }
                    this.attributes[attrName].value[i + attrSize * vertexOffset] = value;
                }
            }
            var len = plane.indices.length;
            for (var i = 0; i < plane.indices.length; i++) {
                this.indices[i + faceOffset] = vertexOffset + plane.indices[this.inside ? (len - i - 1) : i];
            }
            faceOffset += plane.indices.length;
            vertexOffset += plane.vertexCount;
        }

        this.boundingBox = new BoundingBox();
        this.boundingBox.max.set(1, 1, 1);
        this.boundingBox.min.set(-1, -1, -1);
    }
function ( ) { var planes = { 'px' : createPlane ( 'px' , this . depthSegments , this . heightSegments ) , 'nx' : createPlane ( 'nx' , this . depthSegments , this . heightSegments ) , 'py' : createPlane ( 'py' , this . widthSegments , this . depthSegments ) , 'ny' : createPlane ( 'ny' , this . widthSegments , this . depthSegments ) , 'pz' : createPlane ( 'pz' , this . widthSegments , this . heightSegments ) , 'nz' : createPlane ( 'nz' , this . widthSegments , this . heightSegments ) , } ; var attrList = [ 'position' , 'texcoord0' , 'normal' ] ; var vertexNumber = 0 ; var faceNumber = 0 ; for ( var pos in planes ) { vertexNumber += planes [ pos ] . vertexCount ; faceNumber += planes [ pos ] . indices . length ; } for ( var k = 0 ; k < attrList . length ; k ++ ) { this . attributes [ attrList [ k ] ] . init ( vertexNumber ) ; } this . indices = new vendor . Uint16Array ( faceNumber ) ; var faceOffset = 0 ; var vertexOffset = 0 ; for ( var pos in planes ) { var plane = planes [ pos ] ; for ( var k = 0 ; k < attrList . length ; k ++ ) { var attrName = attrList [ k ] ; var attrArray = plane . attributes [ attrName ] . value ; var attrSize = plane . attributes [ attrName ] . size ; var isNormal = attrName === 'normal' ; for ( var i = 0 ; i < attrArray . length ; i ++ ) { var value = attrArray [ i ] ; if ( this . inside && isNormal ) { value = - value ; } this . attributes [ attrName ] . value [ i + attrSize * vertexOffset ] = value ; } } var len = plane . indices . length ; for ( var i = 0 ; i < plane . indices . length ; i ++ ) { this . indices [ i + faceOffset ] = vertexOffset + plane . indices [ this . inside ? ( len - i - 1 ) : i ] ; } faceOffset += plane . indices . length ; vertexOffset += plane . vertexCount ; } this . boundingBox = new BoundingBox ( ) ; this . boundingBox . max . set ( 1 , 1 , 1 ) ; this . boundingBox . min . set ( - 1 , - 1 , - 1 ) ; }
Build cube geometry
Build cube geometry