code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function textureNeedsPowerOfTwo( texture ) {
if ( texture.wrapS !== THREE.ClampToEdgeWrapping || texture.wrapT !== THREE.ClampToEdgeWrapping ) return true;
if ( texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) return true;
return false;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | textureNeedsPowerOfTwo | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function makePowerOfTwo( image ) {
if ( image instanceof HTMLImageElement || image instanceof HTMLCanvasElement ) {
var canvas = document.createElement( 'canvas' );
canvas.width = THREE.Math.nearestPowerOfTwo( image.width );
canvas.height = THREE.Math.nearestPowerOfTwo( image.height );
var context = ca... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | makePowerOfTwo | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setTextureCube ( texture, slot ) {
var textureProperties = properties.get( texture );
if ( texture.image.length === 6 ) {
if ( texture.version > 0 && textureProperties.__version !== texture.version ) {
if ( ! textureProperties.__image__webglTextureCube ) {
texture.addEventListener( 'dispos... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setTextureCube | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setTextureCubeDynamic ( texture, slot ) {
state.activeTexture( _gl.TEXTURE0 + slot );
state.bindTexture( _gl.TEXTURE_CUBE_MAP, properties.get( texture ).__webglTexture );
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setTextureCubeDynamic | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupFrameBufferTexture ( framebuffer, renderTarget, attachment, textureTarget ) {
var glFormat = paramThreeToGL( renderTarget.texture.format );
var glType = paramThreeToGL( renderTarget.texture.type );
state.texImage2D( textureTarget, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, g... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupFrameBufferTexture | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupRenderBufferStorage ( renderbuffer, renderTarget ) {
_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );
if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {
_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height );
_gl.frame... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupRenderBufferStorage | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupDepthTexture ( framebuffer, renderTarget ) {
var isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );
if ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!');
_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
if ( !( renderTarget.depthTexture in... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupDepthTexture | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupDepthRenderbuffer( renderTarget ) {
var renderTargetProperties = properties.get( renderTarget );
var isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );
if ( renderTarget.depthTexture ) {
if ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');
... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupDepthRenderbuffer | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setupRenderTarget( renderTarget ) {
var renderTargetProperties = properties.get( renderTarget );
var textureProperties = properties.get( renderTarget.texture );
renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
textureProperties.__webglTexture = _gl.createTexture();
_infoMemory.t... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | setupRenderTarget | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function updateRenderTargetMipmap( renderTarget ) {
var target = renderTarget instanceof THREE.WebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;
var texture = properties.get( renderTarget.texture ).__webglTexture;
state.bindTexture( target, texture );
_gl.generateMipmap( target );
state.bindTex... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | updateRenderTargetMipmap | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function filterFallback ( f ) {
if ( f === THREE.NearestFilter || f === THREE.NearestMipMapNearestFilter || f === THREE.NearestMipMapLinearFilter ) {
return _gl.NEAREST;
}
return _gl.LINEAR;
} | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | filterFallback | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function paramThreeToGL ( p ) {
var extension;
if ( p === THREE.RepeatWrapping ) return _gl.REPEAT;
if ( p === THREE.ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;
if ( p === THREE.MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;
if ( p === THREE.NearestFilter ) return _gl.NEAREST;
if ( p === THREE.... | @author supereggbert / http://www.paulbrunt.co.uk/
@author mrdoob / http://mrdoob.com/
@author alteredq / http://alteredqualia.com/
@author szimek / https://github.com/szimek/
@author tschw | paramThreeToGL | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getDepthMaterial( object, material, isPointLight, lightPositionWorld ) {
var geometry = object.geometry;
var result = null;
var materialVariants = _depthMaterials;
var customMaterial = object.customDepthMaterial;
if ( isPointLight ) {
materialVariants = _distanceMaterials;
customMaterial =... | @author alteredq / http://alteredqualia.com/
@author mrdoob / http://mrdoob.com/ | getDepthMaterial | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function projectObject( object, camera, shadowCamera ) {
if ( object.visible === false ) return;
if ( object.layers.test( camera.layers ) && ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.Points ) ) {
if ( object.castShadow && ( object.frustumCulled === false || _fru... | @author alteredq / http://alteredqualia.com/
@author mrdoob / http://mrdoob.com/ | projectObject | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
UniformContainer = function() {
this.seq = [];
this.map = {};
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | UniformContainer | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
uncacheTemporaryArrays = function() {
arrayCacheF32.length = 0;
arrayCacheI32.length = 0;
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | uncacheTemporaryArrays | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
flatten = function( array, nBlocks, blockSize ) {
var firstElem = array[ 0 ];
if ( firstElem <= 0 || firstElem > 0 ) return array;
// unoptimized: ! isNaN( firstElem )
// see http://jacksondunstan.com/articles/983
var n = nBlocks * blockSize,
r = arrayCacheF32[ n ];
if ( r === undefined ) {
... | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | flatten | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
allocTexUnits = function( renderer, n ) {
var r = arrayCacheI32[ n ];
if ( r === undefined ) {
r = new Int32Array( n );
arrayCacheI32[ n ] = r;
}
for ( var i = 0; i !== n; ++ i )
r[ i ] = renderer.allocTextureUnit();
return r;
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | allocTexUnits | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValue2fv = function( gl, v ) {
if ( v.x === undefined ) gl.uniform2fv( this.addr, v );
else gl.uniform2f( this.addr, v.x, v.y );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValue2fv | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValue3fv = function( gl, v ) {
if ( v.x !== undefined )
gl.uniform3f( this.addr, v.x, v.y, v.z );
else if ( v.r !== undefined )
gl.uniform3f( this.addr, v.r, v.g, v.b );
else
gl.uniform3fv( this.addr, v );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValue3fv | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValue4fv = function( gl, v ) {
if ( v.x === undefined ) gl.uniform4fv( this.addr, v );
else gl.uniform4f( this.addr, v.x, v.y, v.z, v.w );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValue4fv | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValue2fm = function( gl, v ) {
gl.uniformMatrix2fv( this.addr, false, v.elements || v );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValue2fm | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValue3fm = function( gl, v ) {
gl.uniformMatrix3fv( this.addr, false, v.elements || v );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValue3fm | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValue4fm = function( gl, v ) {
gl.uniformMatrix4fv( this.addr, false, v.elements || v );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValue4fm | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueT1 = function( gl, v, renderer ) {
var unit = renderer.allocTextureUnit();
gl.uniform1i( this.addr, unit );
if ( v ) renderer.setTexture2D( v, unit );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueT1 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueT6 = function( gl, v, renderer ) {
var unit = renderer.allocTextureUnit();
gl.uniform1i( this.addr, unit );
if ( v ) renderer.setTextureCube( v, unit );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueT6 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
getSingularSetter = function( type ) {
switch ( type ) {
case 0x1406: return setValue1f; // FLOAT
case 0x8b50: return setValue2fv; // _VEC2
case 0x8b51: return setValue3fv; // _VEC3
case 0x8b52: return setValue4fv; // _VEC4
case 0x8b5a: return setValue2fm; // _MAT2
case 0x8b5b: return setV... | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | getSingularSetter | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueV2a = function( gl, v ) {
gl.uniform2fv( this.addr, flatten( v, this.size, 2 ) );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueV2a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueV3a = function( gl, v ) {
gl.uniform3fv( this.addr, flatten( v, this.size, 3 ) );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueV3a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueV4a = function( gl, v ) {
gl.uniform4fv( this.addr, flatten( v, this.size, 4 ) );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueV4a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueM2a = function( gl, v ) {
gl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueM2a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueM3a = function( gl, v ) {
gl.uniformMatrix3fv( this.addr, false, flatten( v, this.size, 9 ) );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueM3a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueM4a = function( gl, v ) {
gl.uniformMatrix4fv( this.addr, false, flatten( v, this.size, 16 ) );
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueM4a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueT1a = function( gl, v, renderer ) {
var n = v.length,
units = allocTexUnits( renderer, n );
gl.uniform1iv( this.addr, units );
for ( var i = 0; i !== n; ++ i ) {
var tex = v[ i ];
if ( tex ) renderer.setTexture2D( tex, units[ i ] );
}
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueT1a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
setValueT6a = function( gl, v, renderer ) {
var n = v.length,
units = allocTexUnits( renderer, n );
gl.uniform1iv( this.addr, units );
for ( var i = 0; i !== n; ++ i ) {
var tex = v[ i ];
if ( tex ) renderer.setTextureCube( tex, units[ i ] );
}
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | setValueT6a | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
getPureArraySetter = function( type ) {
switch ( type ) {
case 0x1406: return setValue1fv; // FLOAT
case 0x8b50: return setValueV2a; // _VEC2
case 0x8b51: return setValueV3a; // _VEC3
case 0x8b52: return setValueV4a; // _VEC4
case 0x8b5a: return setValueM2a; // _MAT2
case 0x8b5b: return se... | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | getPureArraySetter | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
SingleUniform = function SingleUniform( id, activeInfo, addr ) {
this.id = id;
this.addr = addr;
this.setValue = getSingularSetter( activeInfo.type );
// this.path = activeInfo.name; // DEBUG
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | SingleUniform | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
PureArrayUniform = function( id, activeInfo, addr ) {
this.id = id;
this.addr = addr;
this.size = activeInfo.size;
this.setValue = getPureArraySetter( activeInfo.type );
// this.path = activeInfo.name; // DEBUG
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | PureArrayUniform | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
StructuredUniform = function( id ) {
this.id = id;
UniformContainer.call( this ); // mix-in
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | StructuredUniform | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
addUniform = function( container, uniformObject ) {
container.seq.push( uniformObject );
container.map[ uniformObject.id ] = uniformObject;
} | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | addUniform | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
parseUniform = function( activeInfo, addr, container ) {
var path = activeInfo.name,
pathLength = path.length;
// reset RegExp object, because of the early exit of a previous run
RePathPart.lastIndex = 0;
for (; ;) {
var match = RePathPart.exec( path ),
matchEnd = RePathPart.lastIndex,
... | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | parseUniform | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
WebGLUniforms = function WebGLUniforms( gl, program, renderer ) {
UniformContainer.call( this );
this.renderer = renderer;
var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );
for ( var i = 0; i !== n; ++ i ) {
var info = gl.getActiveUniform( program, i ),
path = info.name,
addr... | Uniforms of a program.
Those form a tree structure with a special top-level container for the root,
which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
Properties of inner nodes including the top-level container:
.seq - array of nested uniforms
.map - nested uniforms by name
Methods of all nodes... | WebGLUniforms | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function init() {
var vertices = new Float32Array( [
- 1, - 1, 0, 0,
1, - 1, 1, 0,
1, 1, 1, 1,
- 1, 1, 0, 1
] );
var faces = new Uint16Array( [
0, 1, 2,
0, 2, 3
] );
// buffers
vertexBuffer = gl.createBuffer();
elementBuffer = gl.createBuffer();
gl.bindBuffer( gl.AR... | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/ | init | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function createProgram ( shader ) {
var program = gl.createProgram();
var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );
var vertexShader = gl.createShader( gl.VERTEX_SHADER );
var prefix = "precision " + renderer.getPrecision() + " float;\n";
gl.shaderSource( fragmentShader, prefix + shader.frag... | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/ | createProgram | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function init() {
var vertices = new Float32Array( [
- 0.5, - 0.5, 0, 0,
0.5, - 0.5, 1, 0,
0.5, 0.5, 1, 1,
- 0.5, 0.5, 0, 1
] );
var faces = new Uint16Array( [
0, 1, 2,
0, 2, 3
] );
vertexBuffer = gl.createBuffer();
elementBuffer = gl.createBuffer();
gl.bindBuffer( gl.AR... | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/ | init | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function createProgram () {
var program = gl.createProgram();
var vertexShader = gl.createShader( gl.VERTEX_SHADER );
var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );
gl.shaderSource( vertexShader, [
'precision ' + renderer.getPrecision() + ' float;',
'uniform mat4 modelViewMatrix;',
'u... | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/ | createProgram | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function painterSortStable ( a, b ) {
if ( a.renderOrder !== b.renderOrder ) {
return a.renderOrder - b.renderOrder;
} else if ( a.z !== b.z ) {
return b.z - a.z;
} else {
return b.id - a.id;
}
} | @author mikael emtinger / http://gomo.se/
@author alteredq / http://alteredqualia.com/ | painterSortStable | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) {
// inOtherPt needs to be collinear to the inSegment
if ( inSegPt1.x !== inSegPt2.x ) {
if ( inSegPt1.x < inSegPt2.x ) {
return ( ( inSegPt1.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt2.x ) );
} else {
return ( ( inSegP... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | point_in_segment_2D_colin | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function intersect_segments_2D( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1, inSeg2Pt2, inExcludeAdjacentSegs ) {
var seg1dx = inSeg1Pt2.x - inSeg1Pt1.x, seg1dy = inSeg1Pt2.y - inSeg1Pt1.y;
var seg2dx = inSeg2Pt2.x - inSeg2Pt1.x, seg2dy = inSeg2Pt2.y - inSeg2Pt1.y;
var seg1seg2dx = inSeg1Pt1.x - inSeg2Pt1.x;
var ... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | intersect_segments_2D | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isPointInsideAngle( inVertex, inLegFromPt, inLegToPt, inOtherPt ) {
// The order of legs is important
// translation of all points, so that Vertex is at (0,0)
var legFromPtX = inLegFromPt.x - inVertex.x, legFromPtY = inLegFromPt.y - inVertex.y;
var legToPtX = inLegToPt.x - inVertex.x, legToPtY ... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | isPointInsideAngle | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function removeHoles( contour, holes ) {
var shape = contour.concat(); // work on this shape
var hole;
function isCutLineInsideAngles( inShapeIdx, inHoleIdx ) {
// Check if hole point lies within angle around shape point
var lastShapeIdx = shape.length - 1;
var prevShapeIdx = inShapeIdx - 1;
... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | removeHoles | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isCutLineInsideAngles( inShapeIdx, inHoleIdx ) {
// Check if hole point lies within angle around shape point
var lastShapeIdx = shape.length - 1;
var prevShapeIdx = inShapeIdx - 1;
if ( prevShapeIdx < 0 ) prevShapeIdx = lastShapeIdx;
var nextShapeIdx = inShapeIdx + 1;
if ( nextShap... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | isCutLineInsideAngles | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function intersectsShapeEdge( inShapePt, inHolePt ) {
// checks for intersections with shape edges
var sIdx, nextIdx, intersection;
for ( sIdx = 0; sIdx < shape.length; sIdx ++ ) {
nextIdx = sIdx + 1; nextIdx %= shape.length;
intersection = intersect_segments_2D( inShapePt, inHolePt, shape[ sIdx... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | intersectsShapeEdge | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function intersectsHoleEdge( inShapePt, inHolePt ) {
// checks for intersections with hole edges
var ihIdx, chkHole,
hIdx, nextIdx, intersection;
for ( ihIdx = 0; ihIdx < indepHoles.length; ihIdx ++ ) {
chkHole = holes[ indepHoles[ ihIdx ]];
for ( hIdx = 0; hIdx < chkHole.length; hIdx ++ ) ... | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | intersectsHoleEdge | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b2p0( t, p ) {
var k = 1 - t;
return k * k * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b2p0 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b2p1( t, p ) {
return 2 * ( 1 - t ) * t * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b2p1 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b2p2( t, p ) {
return t * t * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b2p2 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b3p0( t, p ) {
var k = 1 - t;
return k * k * k * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b3p0 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b3p1( t, p ) {
var k = 1 - t;
return 3 * k * k * t * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b3p1 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b3p2( t, p ) {
var k = 1 - t;
return 3 * k * t * t * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b3p2 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function b3p3( t, p ) {
return t * t * t * p;
} | Triangulate: ERROR - probable bad polygon!
//throw ( "Warning, unable to triangulate polygon!" );
//return null;
// Sometimes warning is fine, especially polygons are triangulated in reverse.
console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );
if ( indices ) r... | b3p3 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function createPaths( text ) {
var chars = String( text ).split( '' );
var scale = size / data.resolution;
var offset = 0;
var paths = [];
for ( var i = 0; i < chars.length; i ++ ) {
var ret = createPath( chars[ i ], scale, offset );
offset += ret.offset;
paths.push( ret.path );
}
... | @author zz85 / http://www.lab4games.net/zz85/blog
@author mrdoob / http://mrdoob.com/ | createPaths | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function createPath( c, scale, offset ) {
var glyph = data.glyphs[ c ] || data.glyphs[ '?' ];
if ( ! glyph ) return;
var path = new THREE.Path();
var pts = [], b2 = THREE.ShapeUtils.b2, b3 = THREE.ShapeUtils.b3;
var x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2, laste;
if ( glyph.o ) {
... | @author zz85 / http://www.lab4games.net/zz85/blog
@author mrdoob / http://mrdoob.com/ | createPath | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function extractSubpaths( inActions ) {
var subPaths = [], lastPath = new THREE.Path();
for ( var i = 0, l = inActions.length; i < l; i ++ ) {
var item = inActions[ i ];
var args = item.args;
var action = item.action;
if ( action === 'moveTo' ) {
if ( lastPath.actions.length !== 0 ) {
... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates free form 2d path using series of points, lines or curves. | extractSubpaths | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function toShapesNoHoles( inSubpaths ) {
var shapes = [];
for ( var i = 0, l = inSubpaths.length; i < l; i ++ ) {
var tmpPath = inSubpaths[ i ];
var tmpShape = new THREE.Shape();
tmpShape.actions = tmpPath.actions;
tmpShape.curves = tmpPath.curves;
shapes.push( tmpShape );
}
//con... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates free form 2d path using series of points, lines or curves. | toShapesNoHoles | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function isPointInsidePolygon( inPt, inPolygon ) {
var polyLen = inPolygon.length;
// inPt on polygon contour => immediate success or
// toggling of inside/outside at every single! intersection point of an edge
// with the horizontal line through inPt, left of inPt
// not counting lowerY endpoints... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates free form 2d path using series of points, lines or curves. | isPointInsidePolygon | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function sortFunction( a, b ) {
return a - b;
} | @author WestLangley / http://github.com/WestLangley | sortFunction | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function scalePt2 ( pt, vec, size ) {
if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" );
return vec.clone().multiplyScalar( size ).add( pt );
} | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | scalePt2 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function getBevelVec( inPt, inPrev, inNext ) {
// computes for inPt the corresponding point inPt' on a new contour
// shifted by 1 unit (length of normalized vector) to the left
// if we walk along contour clockwise, this new contour is outside the old one
//
// inPt' is the intersection of the two lines p... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | getBevelVec | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function buildLidFaces() {
if ( bevelEnabled ) {
var layer = 0; // steps + 1
var offset = vlen * layer;
// Bottom faces
for ( i = 0; i < flen; i ++ ) {
face = faces[ i ];
f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );
}
layer = steps + bevelSegments * 2;
offset =... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | buildLidFaces | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function buildSideFaces() {
var layeroffset = 0;
sidewalls( contour, layeroffset );
layeroffset += contour.length;
for ( h = 0, hl = holes.length; h < hl; h ++ ) {
ahole = holes[ h ];
sidewalls( ahole, layeroffset );
//, true
layeroffset += ahole.length;
}
} | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | buildSideFaces | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function sidewalls( contour, layeroffset ) {
var j, k;
i = contour.length;
while ( -- i >= 0 ) {
j = i;
k = i - 1;
if ( k < 0 ) k = contour.length - 1;
//console.log('b', i,j, i-1, k,vertices.length);
var s = 0, sl = steps + bevelSegments * 2;
for ( s = 0; s < sl; s ++ ) {
var slen1 ... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | sidewalls | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function v( x, y, z ) {
scope.vertices.push( new THREE.Vector3( x, y, z ) );
} | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | v | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function f3( a, b, c ) {
a += shapesOffset;
b += shapesOffset;
c += shapesOffset;
scope.faces.push( new THREE.Face3( a, b, c, null, null, 0 ) );
var uvs = uvgen.generateTopUV( scope, a, b, c );
scope.faceVertexUvs[ 0 ].push( uvs );
} | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | f3 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function f4( a, b, c, d, wallContour, stepIndex, stepsLength, contourIndex1, contourIndex2 ) {
a += shapesOffset;
b += shapesOffset;
c += shapesOffset;
d += shapesOffset;
scope.faces.push( new THREE.Face3( a, b, d, null, null, 1 ) );
scope.faces.push( new THREE.Face3( b, c, d, null, null, 1 ) );
var uv... | @author zz85 / http://www.lab4games.net/zz85/blog
Creates extruded geometry from a path shape.
parameters = {
curveSegments: <int>, // number of points on the curves
steps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too
amount: <int>, // Depth to extrude the... | f4 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function calculatePositionOnCurve( u, p, q, radius, position ) {
var cu = Math.cos( u );
var su = Math.sin( u );
var quOverP = q / p * u;
var cs = Math.cos( quOverP );
position.x = radius * ( 2 + cs ) * 0.5 * cu;
position.y = radius * ( 2 + cs ) * su * 0.5;
position.z = radius * Math.sin( quOverP ) * 0.... | @author Mugen87 / https://github.com/Mugen87
see: http://www.blackpawn.com/texts/pqtorus/ | calculatePositionOnCurve | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function vert( x, y, z ) {
return scope.vertices.push( new THREE.Vector3( x, y, z ) ) - 1;
} | @author WestLangley / https://github.com/WestLangley
@author zz85 / https://github.com/zz85
@author miningold / https://github.com/miningold
@author jonobr1 / https://github.com/jonobr1
Modified from the TorusKnotGeometry by @oosmoxiecode
Creates a tube which extrudes along a 3d spline
Uses parallel transport frames... | vert | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function initialNormal3() {
// select an initial normal vector perpendicular to the first tangent vector,
// and in the direction of the smallest tangent xyz component
normals[ 0 ] = new THREE.Vector3();
binormals[ 0 ] = new THREE.Vector3();
smallest = Number.MAX_VALUE;
tx = Math.abs( tangents[ 0 ].x );
... | @author WestLangley / https://github.com/WestLangley
@author zz85 / https://github.com/zz85
@author miningold / https://github.com/miningold
@author jonobr1 / https://github.com/jonobr1
Modified from the TorusKnotGeometry by @oosmoxiecode
Creates a tube which extrudes along a 3d spline
Uses parallel transport frames... | initialNormal3 | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function prepare( vector ) {
var vertex = vector.normalize().clone();
vertex.index = that.vertices.push( vertex ) - 1;
// Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle.
var u = azimuth( vector ) / 2 / Math.PI + 0.5;
var v = inclination( vector ) / Math.PI ... | @author clockworkgeek / https://github.com/clockworkgeek
@author timothypratley / https://github.com/timothypratley
@author WestLangley / http://github.com/WestLangley | prepare | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function make( v1, v2, v3, materialIndex ) {
var face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ], undefined, materialIndex );
that.faces.push( face );
centroid.copy( v1 ).add( v2 ).add( v3 ).divideScalar( 3 );
var azi = azimuth( centroid );
that.faceVertexUvs[ ... | @author clockworkgeek / https://github.com/clockworkgeek
@author timothypratley / https://github.com/timothypratley
@author WestLangley / http://github.com/WestLangley | make | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function subdivide( face, detail ) {
var cols = Math.pow( 2, detail );
var a = prepare( that.vertices[ face.a ] );
var b = prepare( that.vertices[ face.b ] );
var c = prepare( that.vertices[ face.c ] );
var v = [];
var materialIndex = face.materialIndex;
// Construct all of the vertices for this subdiv... | @author clockworkgeek / https://github.com/clockworkgeek
@author timothypratley / https://github.com/timothypratley
@author WestLangley / http://github.com/WestLangley | subdivide | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function azimuth( vector ) {
return Math.atan2( vector.z, - vector.x );
} | @author clockworkgeek / https://github.com/clockworkgeek
@author timothypratley / https://github.com/timothypratley
@author WestLangley / http://github.com/WestLangley | azimuth | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function inclination( vector ) {
return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );
} | @author clockworkgeek / https://github.com/clockworkgeek
@author timothypratley / https://github.com/timothypratley
@author WestLangley / http://github.com/WestLangley | inclination | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function correctUV( uv, vector, azimuth ) {
if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) uv = new THREE.Vector2( uv.x - 1, uv.y );
if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) uv = new THREE.Vector2( azimuth / 2 / Math.PI + 0.5, uv.y );
return uv.clone();
} | @author clockworkgeek / https://github.com/clockworkgeek
@author timothypratley / https://github.com/timothypratley
@author WestLangley / http://github.com/WestLangley | correctUV | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function addLine( a, b, hex ) {
addPoint( a, hex );
addPoint( b, hex );
} | @author alteredq / http://alteredqualia.com/
- shows frustum, line of sight and up of the camera
- suitable for fast updates
- based on frustum visualization in lightgl.js shadowmap example
http://evanw.github.com/lightgl.js/tests/shadowmap.html | addLine | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function addPoint( id, hex ) {
geometry.vertices.push( new THREE.Vector3() );
geometry.colors.push( new THREE.Color( hex ) );
if ( pointMap[ id ] === undefined ) {
pointMap[ id ] = [];
}
pointMap[ id ].push( geometry.vertices.length - 1 );
} | @author alteredq / http://alteredqualia.com/
- shows frustum, line of sight and up of the camera
- suitable for fast updates
- based on frustum visualization in lightgl.js shadowmap example
http://evanw.github.com/lightgl.js/tests/shadowmap.html | addPoint | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
function setPoint( point, x, y, z ) {
vector.set( x, y, z ).unproject( camera );
var points = pointMap[ point ];
if ( points !== undefined ) {
for ( var i = 0, il = points.length; i < il; i ++ ) {
geometry.vertices[ points[ i ] ].copy( vector );
}
}
} | @author alteredq / http://alteredqualia.com/
- shows frustum, line of sight and up of the camera
- suitable for fast updates
- based on frustum visualization in lightgl.js shadowmap example
http://evanw.github.com/lightgl.js/tests/shadowmap.html | setPoint | javascript | UDST/vizicities | examples/vendor/three.js | https://github.com/UDST/vizicities/blob/master/examples/vendor/three.js | BSD-3-Clause |
Sky = function () {
var skyShader = THREE.ShaderLib[ 'sky' ];
var skyUniforms = THREE.UniformsUtils.clone( skyShader.uniforms );
var skyMat = new THREE.ShaderMaterial( {
fragmentShader: skyShader.fragmentShader,
vertexShader: skyShader.vertexShader,
uniforms: skyUniforms,
side: THREE.BackSide
} );
var s... | @author zz85 / https://github.com/zz85
Based on 'A Practical Analytic Model for Daylight'
aka The Preetham Model, the de facto standard analytic skydome model
http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf
First implemented by Simon Wallner
http://www.simonwallner.at/projects/atmospheric-scattering
Improve... | Sky | javascript | UDST/vizicities | src/layer/environment/Sky.js | https://github.com/UDST/vizicities/blob/master/src/layer/environment/Sky.js | BSD-3-Clause |
CSS3DObject = function ( element ) {
THREE.Object3D.call( this );
this.element = element;
this.element.style.position = 'absolute';
this.addEventListener( 'removed', function ( event ) {
if ( this.element.parentNode !== null ) {
this.element.parentNode.removeChild( this.element );
}
} );
} | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | CSS3DObject | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
CSS3DSprite = function ( element ) {
CSS3DObject.call( this, element );
} | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | CSS3DSprite | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
CSS3DRenderer = function () {
console.log( 'THREE.CSS3DRenderer', THREE.REVISION );
var _width, _height;
var _widthHalf, _heightHalf;
var matrix = new THREE.Matrix4();
var cache = {
camera: { fov: 0, style: '' },
objects: {}
};
var domElement = document.createElement( 'div' );
domElement.style.overflow... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | CSS3DRenderer | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
epsilon = function ( value ) {
return Math.abs( value ) < Number.EPSILON ? 0 : value;
} | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | epsilon | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
getCameraCSSMatrix = function ( matrix ) {
var elements = matrix.elements;
return 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( - elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' ... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | getCameraCSSMatrix | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
getObjectCSSMatrix = function ( matrix ) {
var elements = matrix.elements;
return 'translate3d(-50%,-50%,0) matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( - elements[ 4 ] ) + ',' +
epsilon(... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | getObjectCSSMatrix | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
renderObject = function ( object, camera ) {
if ( object instanceof CSS3DObject ) {
var style;
if ( object instanceof CSS3DSprite ) {
// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
matrix.copy( camera.matrixWorldInverse );
matrix.transpose();
matrix.copyPosit... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | renderObject | javascript | UDST/vizicities | src/vendor/CSS3DRenderer.js | https://github.com/UDST/vizicities/blob/master/src/vendor/CSS3DRenderer.js | BSD-3-Clause |
OrbitControls = function ( object, domElement ) {
this.object = object;
this.domElement = ( domElement !== undefined ) ? domElement : document;
// Set to false to disable this control
this.enabled = true;
// "target" sets the location of focus, where the object orbits around
this.target = new THREE.Vector3();... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | OrbitControls | javascript | UDST/vizicities | src/vendor/OrbitControls.js | https://github.com/UDST/vizicities/blob/master/src/vendor/OrbitControls.js | BSD-3-Clause |
function getAutoRotationAngle() {
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | getAutoRotationAngle | javascript | UDST/vizicities | src/vendor/OrbitControls.js | https://github.com/UDST/vizicities/blob/master/src/vendor/OrbitControls.js | BSD-3-Clause |
function getZoomScale() {
return Math.pow( 0.95, scope.zoomSpeed );
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | getZoomScale | javascript | UDST/vizicities | src/vendor/OrbitControls.js | https://github.com/UDST/vizicities/blob/master/src/vendor/OrbitControls.js | BSD-3-Clause |
function rotateLeft( angle ) {
thetaDelta -= angle;
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | rotateLeft | javascript | UDST/vizicities | src/vendor/OrbitControls.js | https://github.com/UDST/vizicities/blob/master/src/vendor/OrbitControls.js | BSD-3-Clause |
function rotateUp( angle ) {
phiDelta -= angle;
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | rotateUp | javascript | UDST/vizicities | src/vendor/OrbitControls.js | https://github.com/UDST/vizicities/blob/master/src/vendor/OrbitControls.js | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.