dist/claygl.es.js
function(x, y) {
        var renderer = this.renderer;

        var ratio = this.downSampleRatio;
        x = Math.ceil(ratio * x);
        y = Math.ceil(ratio * (this.height - y));

        this._frameBuffer.bind(renderer);
        var pixel = new Uint8Array(4);
        var _gl = renderer.gl;
        // TODO out of bounds ?
        // preserveDrawingBuffer ?
        _gl.readPixels(x, y, 1, 1, _gl.RGBA, _gl.UNSIGNED_BYTE, pixel);
        this._frameBuffer.unbind(renderer);
        // Skip interpolated pixel because of anti alias
        if (pixel[3] === 255) {
            var id = unpackID(pixel[0], pixel[1], pixel[2]);
            if (id) {
                var el = this._lookupTable[id - this.lookupOffset];
                return el;
            }
        }
    }
function(x, y) {
        var renderer = this.renderer;

        var ratio = this.downSampleRatio;
        x = Math.ceil(ratio * x);
        y = Math.ceil(ratio * (this.height - y));

        this._frameBuffer.bind(renderer);
        var pixel = new Uint8Array(4);
        var _gl = renderer.gl;
        // TODO out of bounds ?
        // preserveDrawingBuffer ?
        _gl.readPixels(x, y, 1, 1, _gl.RGBA, _gl.UNSIGNED_BYTE, pixel);
        this._frameBuffer.unbind(renderer);
        // Skip interpolated pixel because of anti alias
        if (pixel[3] === 255) {
            var id = unpackID(pixel[0], pixel[1], pixel[2]);
            if (id) {
                var el = this._lookupTable[id - this.lookupOffset];
                return el;
            }
        }
    }
function ( x , y ) { var renderer = this . renderer ; var ratio = this . downSampleRatio ; x = Math . ceil ( ratio * x ) ; y = Math . ceil ( ratio * ( this . height - y ) ) ; this . _frameBuffer . bind ( renderer ) ; var pixel = new Uint8Array ( 4 ) ; var _gl = renderer . gl ; // TODO out of bounds ? // preserveDrawingBuffer ? _gl . readPixels ( x , y , 1 , 1 , _gl . RGBA , _gl . UNSIGNED_BYTE , pixel ) ; this . _frameBuffer . unbind ( renderer ) ; // Skip interpolated pixel because of anti alias if ( pixel [ 3 ] === 255 ) { var id = unpackID ( pixel [ 0 ] , pixel [ 1 ] , pixel [ 2 ] ) ; if ( id ) { var el = this . _lookupTable [ id - this . lookupOffset ] ; return el ; } } }
Pick the object
@param  {number} x Mouse position x
@param  {number} y Mouse position y
@return {clay.Node}
Pick the object