language stringclasses 1 value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2 classes |
|---|---|---|---|---|---|---|---|
Other | mrdoob | three.js | f081dd161b3808cb1090802a4faf5bc56c5cbfe8.json | Remove extra a tag in webgl_morphotarget_human | examples/webgl_morphtargets_human.html | @@ -33,7 +33,7 @@
<div id="container"></div>
<div id="info">
- <a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl - morph targets - human</a>
+ <a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> webgl - morph targets - human
</div>
<script src="../build/three.js"></script> | false |
Other | mrdoob | three.js | 67521c1833b7004bdf8b936d61aebad82f3f75c7.json | Remove unnecessary comma in webgl_materials_cars | examples/webgl_materials_cars.html | @@ -312,7 +312,7 @@
[ "Bronze", mlib[ "Bronze" ] ],
[ "Chrome", mlib[ "Chrome" ] ]
- ],
+ ]
};
@@ -353,7 +353,7 @@
[ "Bronze", mlib[ "Bronze" ] ],
[ "Chrome", mlib[ "Chrome" ] ]
- ],
+ ]
};
@@ -413,7 +413,7 @@
[ "Bronze", mlib[ "Bronze" ] ],
[ "Chrome", mlib[ "Chrome" ] ]
- ],
+ ]
};
| false |
Other | mrdoob | three.js | d78fa64a4d365b3d751eb6a9193bb6993198498a.json | Fix wrong hexa color in webgl_loader_sea3d_morph | examples/webgl_loader_sea3d_morph.html | @@ -28,7 +28,7 @@
</head>
<body>
<div id="info">
- <a href="http://threejs.org" target="_blank">three.js</a> - asset by <a href="https://github.com/sunag/sea3d" style="color:#FFFFF" target="_blank">sea3d</a>
+ <a href="http://threejs.org" target="_blank">three.js</a> - asset by <a href="https://github.com/sunag/sea3d" style="color:#FFFFFF" target="_blank">sea3d</a>
<div id="description">Flag is Vertex Animation / Teapot is Morpher</div>
</div>
| false |
Other | mrdoob | three.js | 0da24de64b0323922858196177deb9a7c0e37da3.json | Fix wrong hexa color in webgl_loader_sea3d | examples/webgl_loader_sea3d.html | @@ -28,7 +28,7 @@
</head>
<body>
<div id="info">
- <a href="http://threejs.org" target="_blank">three.js</a> - asset by <a href="https://github.com/sunag/sea3d" style="color:#FFFFF" target="_blank">sea3d</a>
+ <a href="http://threejs.org" target="_blank">three.js</a> - asset by <a href="https://github.com/sunag/sea3d" style="color:#FFFFFF" target="_blank">sea3d</a>
</div>
<script src="../build/three.js"></script> | false |
Other | mrdoob | three.js | b13b944c03596b35bf0c6519e173b48945703cf6.json | Add missing semicolon in webgl_loader_mmd | examples/webgl_loader_mmd.html | @@ -79,7 +79,7 @@
scene = new THREE.Scene();
- var gridHelper = new THREE.GridHelper( 100, 100 )
+ var gridHelper = new THREE.GridHelper( 100, 100 );
gridHelper.position.y = -10;
scene.add( gridHelper );
| false |
Other | mrdoob | three.js | 48ccd9fff537c8e00b442bed66ea0160b3baedfa.json | Remove extra curly-brace in webgl_loader_bvh | examples/webgl_loader_bvh.html | @@ -21,7 +21,6 @@
text-align: center;
color: #000000;
}
-}
</style>
</head> | false |
Other | mrdoob | three.js | 8b203220f20f0659c134ed0cbdc828a2699956ab.json | Remove unnecessary comma in webgl_lines_cubes | examples/webgl_lines_cubes.html | @@ -104,7 +104,7 @@
[ m1, scale*0.5, [2*d, 0, 0], g1 ], [ m1, scale*0.5, [-2*d, 0, 0], g1 ],
[ m1, scale*0.5, [2*d, d, 0], g1 ], [ m1, scale*0.5, [-2*d, d, 0], g1 ],
- [ m1, scale*0.5, [2*d, -d, 0], g1 ], [ m1, scale*0.5, [-2*d, -d, 0], g1 ],
+ [ m1, scale*0.5, [2*d, -d, 0], g1 ], [ m1, scale*0.5, [-2*d, -d, 0], g1 ]
];
for ( i = 0; i < parameters.length; i ++ ) { | false |
Other | mrdoob | three.js | fb8d7a0269b8e07a4062b5a2e0b20da567c55a15.json | Remove variable duplicate in webgl_pointlights | examples/webgl_lights_pointlights.html | @@ -50,7 +50,7 @@
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
var camera, scene, renderer,
- particle1, particle2, particle2,
+ particle1, particle2,
light1, light2, light3, light4,
object, loader;
| false |
Other | mrdoob | three.js | e045374560c0dbb90c0385e07abd4f146d0e5c19.json | Remove unnecessary comma in webgl_light_physical | examples/webgl_lights_physical.html | @@ -80,7 +80,7 @@
"400 lx (Sunrise/Sunset)": 400,
"1000 lx (Overcast)": 1000,
"18000 lx (Daylight)": 18000,
- "50000 lx (Direct Sun)": 50000,
+ "50000 lx (Direct Sun)": 50000
};
var params = {
@@ -131,7 +131,7 @@
roughness: 0.8,
color: 0xffffff,
metalness: 0.2,
- bumpScale: 0.0005,
+ bumpScale: 0.0005
});
var textureLoader = new THREE.TextureLoader();
textureLoader.load( "textures/hardwood2_diffuse.jpg", function( map ) { | false |
Other | mrdoob | three.js | 695071e617827f48179d7c138415f85441fd5efe.json | add side to hdr example. | examples/webgl_materials_envmaps_hdr.html | @@ -63,7 +63,8 @@
roughness: 1.0,
bumpScale: 0.3,
background: false,
- exposure: 1.0
+ exposure: 1.0,
+ side: 'front'
};
var camera, scene, renderer, controls, objects = [];
var hdrCubeMap;
@@ -91,8 +92,8 @@
standardMaterial = new THREE.MeshStandardMaterial( {
map: null,
bumpScale: - 0.05,
- color: 0xffffff,
- metalness: 1.0,
+ color: 0xff4444,
+ metalness: 0.5,
roughness: 1.0,
shading: THREE.SmoothShading
} );
@@ -127,6 +128,7 @@
map.wrapT = THREE.RepeatWrapping;
map.anisotropy = 4;
map.repeat.set( 9, 2 );
+ standardMaterial.map = map;
standardMaterial.roughnessMap = map;
standardMaterial.bumpMap = map;
standardMaterial.needsUpdate = true;
@@ -219,6 +221,7 @@
gui.add( params, 'roughness', 0, 1 );
gui.add( params, 'bumpScale', - 1, 1 );
gui.add( params, 'exposure', 0.1, 2 );
+ gui.add( params, 'side', [ 'front', 'back', 'double' ] );
gui.open();
}
@@ -275,6 +278,23 @@
}
+
+ var side = standardMaterial.side;
+
+ switch ( params.side ) {
+
+ case 'front': side = THREE.FrontSide; break;
+ case 'back': side = THREE.BackSide; break;
+ case 'double': side = THREE.DoubleSide; break;
+
+ }
+
+ if( standardMaterial.side !== side ) {
+
+ standardMaterial.side = side;
+ standardMaterial.needsUpdate = true;
+
+ }
}
renderer.toneMappingExposure = Math.pow( params.exposure, 4.0 ); | false |
Other | mrdoob | three.js | 32ef25a24b4abbfdc67294c73baa668f8a1fddae.json | fix documentation (#10039) | docs/api/core/BufferAttribute.html | @@ -54,7 +54,7 @@ <h3>[property:Integer version]</h3>
A version number, incremented every time the needsUpdate property is set to true.
</div>
- <h3>[property:Function onUploadCallback]</h3>
+ <h3>[property:Function onUpload]</h3>
<div>
A callback function that is executed after the Renderer has transfered the attribute array data to the GPU.
</div> | false |
Other | mrdoob | three.js | 6078e0852da884fc8aec918ffe0d5c540c52a529.json | add link to project wiki in README.md (#9987) | README.md | @@ -5,8 +5,11 @@ three.js
The aim of the project is to create an easy to use, lightweight, 3D library. The library provides <canvas>, <svg>, CSS3D and WebGL renderers.
-[Examples](http://threejs.org/examples/) — [Documentation](http://threejs.org/docs/) — [Migrating](https://github.com/mrdoob/three.js/wiki/Migration) — [Help](http://stackoverflow.com/questions/tagged/three.js)
-
+[Examples](http://threejs.org/examples/) —
+[Documentation](http://threejs.org/docs/) —
+[Wiki](https://github.com/mrdoob/three.js/wiki) —
+[Migrating](https://github.com/mrdoob/three.js/wiki/Migration) —
+[Help](http://stackoverflow.com/questions/tagged/three.js)
### Usage ###
| false |
Other | mrdoob | three.js | 4342cf8ec12a68bdd53627731b63d11358aede72.json | Remove unnecessary lines from OutlineEffect | examples/js/effects/OutlineEffect.js | @@ -3,9 +3,6 @@
*
* Reference: https://en.wikipedia.org/wiki/Cel_shading
*
- * Dependencies
- * - THREE.ChainableEffect
- *
* // How to set default outline parameters
* new THREE.OutlineEffect( renderer, {
* defaultThickNess: 0.01, | false |
Other | mrdoob | three.js | 3c02fefe57e1f17ba08a1aca0c3d8633e0185a51.json | Fix typo in comment (#10021) | examples/js/controls/OrbitControls.js | @@ -11,7 +11,7 @@
//
// Orbit - left mouse / touch: one finger move
// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
-// Pan - right mouse, or arrow keys / touch: three finter swipe
+// Pan - right mouse, or arrow keys / touch: three finger swipe
THREE.OrbitControls = function ( object, domElement ) {
| false |
Other | mrdoob | three.js | cb2c0ea1fb0ec23b20eb44474499bea10a38b452.json | Add CCDIKHelper (#9996)
* Add CCDIKHelper
* Clean up MMDPhysics.js
* Fix typo | examples/js/animation/CCDIKSolver.js | @@ -205,3 +205,190 @@ THREE.CCDIKSolver.prototype = {
}
};
+
+
+THREE.CCDIKHelper = function ( mesh ) {
+
+ if ( mesh.geometry.iks === undefined || mesh.skeleton === undefined ) {
+
+ throw 'THREE.CCDIKHelper requires iks in mesh.geometry and skeleton in mesh.';
+
+ }
+
+ THREE.Object3D.call( this );
+
+ this.root = mesh;
+
+ this.matrix = mesh.matrixWorld;
+ this.matrixAutoUpdate = false;
+
+ this.sphereGeometry = new THREE.SphereBufferGeometry( 0.25, 16, 8 );
+
+ this.targetSphereMaterial = new THREE.MeshBasicMaterial( {
+ color: new THREE.Color( 0xff8888 ),
+ depthTest: false,
+ depthWrite: false,
+ transparent: true
+ } );
+
+ this.effectorSphereMaterial = new THREE.MeshBasicMaterial( {
+ color: new THREE.Color( 0x88ff88 ),
+ depthTest: false,
+ depthWrite: false,
+ transparent: true
+ } );
+
+ this.linkSphereMaterial = new THREE.MeshBasicMaterial( {
+ color: new THREE.Color( 0x8888ff ),
+ depthTest: false,
+ depthWrite: false,
+ transparent: true
+ } );
+
+ this.lineMaterial = new THREE.LineBasicMaterial( {
+ color: new THREE.Color( 0xff0000 ),
+ depthTest: false,
+ depthWrite: false,
+ transparent: true
+ } );
+
+ this._init();
+ this.update();
+
+};
+
+THREE.CCDIKHelper.prototype = Object.create( THREE.Object3D.prototype );
+THREE.CCDIKHelper.prototype.constructor = THREE.CCDIKHelper;
+
+THREE.CCDIKHelper.prototype._init = function () {
+
+ var self = this;
+ var mesh = this.root;
+ var iks = mesh.geometry.iks;
+
+ function createLineGeometry( ik ) {
+
+ var geometry = new THREE.BufferGeometry();
+ var vertices = new Float32Array( ( 2 + ik.links.length ) * 3 );
+ geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
+
+ return geometry;
+
+ }
+
+ function createTargetMesh() {
+
+ return new THREE.Mesh( self.sphereGeometry, self.targetSphereMaterial );
+
+ }
+
+ function createEffectorMesh() {
+
+ return new THREE.Mesh( self.sphereGeometry, self.effectorSphereMaterial );
+
+ }
+
+ function createLinkMesh() {
+
+ return new THREE.Mesh( self.sphereGeometry, self.linkSphereMaterial );
+
+ }
+
+ function createLine( ik ) {
+
+ return new THREE.Line( createLineGeometry( ik ), self.lineMaterial );
+
+ }
+
+ for ( var i = 0, il = iks.length; i < il; i ++ ) {
+
+ var ik = iks[ i ];
+
+ this.add( createTargetMesh() );
+ this.add( createEffectorMesh() );
+
+ for ( var j = 0, jl = ik.links.length; j < jl; j ++ ) {
+
+ this.add( createLinkMesh() );
+
+ }
+
+ this.add( createLine( ik ) );
+
+ }
+
+};
+
+THREE.CCDIKHelper.prototype.update = function () {
+
+ var offset = 0;
+
+ var mesh = this.root;
+ var iks = mesh.geometry.iks;
+ var bones = mesh.skeleton.bones;
+
+ var matrixWorldInv = new THREE.Matrix4().getInverse( mesh.matrixWorld );
+ var vector = new THREE.Vector3();
+
+ function getPosition( bone ) {
+
+ vector.setFromMatrixPosition( bone.matrixWorld );
+ vector.applyMatrix4( matrixWorldInv );
+
+ return vector;
+
+ }
+
+ function setPositionOfBoneToAttributeArray( array, index, bone ) {
+
+ var v = getPosition( bone );
+
+ array[ index * 3 + 0 ] = v.x;
+ array[ index * 3 + 1 ] = v.y;
+ array[ index * 3 + 2 ] = v.z;
+
+ }
+
+ for ( var i = 0, il = iks.length; i < il; i ++ ) {
+
+ var ik = iks[ i ];
+
+ var targetBone = bones[ ik.target ];
+ var effectorBone = bones[ ik.effector ];
+
+ var targetMesh = this.children[ offset ++ ];
+ var effectorMesh = this.children[ offset ++ ];
+
+ targetMesh.position.copy( getPosition( targetBone ) );
+ effectorMesh.position.copy( getPosition( effectorBone ) );
+
+ for ( var j = 0, jl = ik.links.length; j < jl; j ++ ) {
+
+ var link = ik.links[ j ];
+ var linkBone = bones[ link.index ];
+
+ var linkMesh = this.children[ offset ++ ];
+
+ linkMesh.position.copy( getPosition( linkBone ) );
+
+ }
+
+ var line = this.children[ offset ++ ];
+ var array = line.geometry.attributes.position.array;
+
+ setPositionOfBoneToAttributeArray( array, 0, targetBone );
+ setPositionOfBoneToAttributeArray( array, 1, effectorBone );
+
+ for ( var j = 0, jl = ik.links.length; j < jl; j ++ ) {
+
+ var link = ik.links[ j ];
+ var linkBone = bones[ link.index ];
+ setPositionOfBoneToAttributeArray( array, j + 2, linkBone );
+
+ }
+
+ line.geometry.attributes.position.needsUpdate = true;
+
+ }
+
+}; | true |
Other | mrdoob | three.js | cb2c0ea1fb0ec23b20eb44474499bea10a38b452.json | Add CCDIKHelper (#9996)
* Add CCDIKHelper
* Clean up MMDPhysics.js
* Fix typo | examples/js/animation/MMDPhysics.js | @@ -1031,11 +1031,6 @@ THREE.MMDPhysics.Constraint.prototype = {
};
-/*
- * This helper displays rigid bodies of mesh for debug.
- * It should be under Scene because it just sets world position/roration to meshes
- * for simplicity.
- */
THREE.MMDPhysicsHelper = function ( mesh ) {
if ( mesh.physics === undefined || mesh.geometry.rigidBodies === undefined ) {
@@ -1046,9 +1041,48 @@ THREE.MMDPhysicsHelper = function ( mesh ) {
THREE.Object3D.call( this );
- this.mesh = mesh;
+ this.root = mesh;
+
+ this.matrix = mesh.matrixWorld;
+ this.matrixAutoUpdate = false;
+
+ this.materials = [];
+
+ this.materials.push(
+ new THREE.MeshBasicMaterial( {
+ color: new THREE.Color( 0xff8888 ),
+ wireframe: true,
+ depthTest: false,
+ depthWrite: false,
+ opacity: 0.25,
+ transparent: true
+ } )
+ );
+
+ this.materials.push(
+ new THREE.MeshBasicMaterial( {
+ color: new THREE.Color( 0x88ff88 ),
+ wireframe: true,
+ depthTest: false,
+ depthWrite: false,
+ opacity: 0.25,
+ transparent: true
+ } )
+ );
+
+ this.materials.push(
+ new THREE.MeshBasicMaterial( {
+ color: new THREE.Color( 0x8888ff ),
+ wireframe: true,
+ depthTest: false,
+ depthWrite: false,
+ opacity: 0.25,
+ transparent: true
+ } )
+ );
this._init();
+ this.update();
};
@@ -1057,6 +1091,9 @@ THREE.MMDPhysicsHelper.prototype.constructor = THREE.MMDPhysicsHelper;
THREE.MMDPhysicsHelper.prototype._init = function () {
+ var mesh = this.root;
+ var rigidBodies = mesh.geometry.rigidBodies;
+
function createGeometry( param ) {
switch ( param.shapeType ) {
@@ -1097,67 +1134,54 @@ THREE.MMDPhysicsHelper.prototype._init = function () {
}
+ for ( var i = 0, il = rigidBodies.length; i < il; i ++ ) {
- function createMaterial( param ) {
+ var param = rigidBodies[ i ];
+ this.add( new THREE.Mesh( createGeometry( param ), this.materials[ param.type ] ) );
- var color;
+ }
- switch ( param.type ) {
+};
- case 0:
- color = 0xff8888;
- break;
+THREE.MMDPhysicsHelper.prototype.update = function () {
- case 1:
- color = 0x88ff88;
- break;
+ var mesh = this.root;
+ var rigidBodies = mesh.geometry.rigidBodies;
+ var bodies = mesh.physics.bodies;
- case 2:
- color = 0x8888ff;
- break;
+ var matrixWorldInv = new THREE.Matrix4().getInverse( mesh.matrixWorld );
+ var vector = new THREE.Vector3();
+ var quaternion = new THREE.Quaternion();
+ var quaternion2 = new THREE.Quaternion();
- default:
- color = 0x000000;
- break;
+ function getPosition( origin ) {
- }
+ vector.set( origin.x(), origin.y(), origin.z() );
+ vector.applyMatrix4( matrixWorldInv );
- return new THREE.MeshBasicMaterial( {
- color: new THREE.Color( color ),
- wireframe: true,
- depthTest: false,
- depthWrite: false,
- opacity: 0.25,
- transparent: true
- } );
+ return vector;
}
- for ( var i = 0, il = this.mesh.geometry.rigidBodies.length; i < il; i ++ ) {
+ function getQuaternion( rotation ) {
- var param = this.mesh.geometry.rigidBodies[ i ];
+ quaternion.set( rotation.x(), rotation.y(), rotation.z(), rotation.w() );
+ quaternion2.setFromRotationMatrix( matrixWorldInv );
+ quaternion2.multiply( quaternion );
- var mesh = new THREE.Mesh( createGeometry( param ), createMaterial( param ) );
- this.add( mesh );
+ return quaternion2;
}
-};
-
-THREE.MMDPhysicsHelper.prototype.update = function () {
+ for ( var i = 0, il = rigidBodies.length; i < il; i ++ ) {
- for ( var i = 0, il = this.mesh.geometry.rigidBodies.length; i < il; i ++ ) {
-
- var body = this.mesh.physics.bodies[ i ].body;
+ var body = bodies[ i ].body;
var mesh = this.children[ i ];
var tr = body.getCenterOfMassTransform();
- var o = tr.getOrigin();
- var r = tr.getRotation();
-
- mesh.position.set( o.x(), o.y(), o.z() );
- mesh.quaternion.set( r.x(), r.y(), r.z(), r.w() );
+ mesh.position.copy( getPosition( tr.getOrigin() ) );
+ mesh.quaternion.copy( getQuaternion( tr.getRotation() ) );
}
| true |
Other | mrdoob | three.js | cb2c0ea1fb0ec23b20eb44474499bea10a38b452.json | Add CCDIKHelper (#9996)
* Add CCDIKHelper
* Clean up MMDPhysics.js
* Fix typo | examples/webgl_loader_mmd.html | @@ -52,7 +52,7 @@
var container, stats;
var mesh, camera, scene, renderer;
- var helper, physicsHelper;
+ var helper, ikHelper, physicsHelper;
var mouseX = 0, mouseY = 0;
@@ -119,6 +119,10 @@
helper.add( mesh );
helper.setAnimation( mesh );
+ // create CCDIKHelper after calling helper.setAnimation()
+ ikHelper = new THREE.CCDIKHelper( mesh );
+ scene.add( ikHelper );
+
/*
* Note: You're recommended to call helper.setPhysics()
* after calling helper.setAnimation().
@@ -186,6 +190,7 @@
helper.animate( clock.getDelta() );
if ( physicsHelper !== undefined ) physicsHelper.update();
+ ikHelper.update();
helper.render( scene, camera );
} else { | true |
Other | mrdoob | three.js | 0d47a62f8df511929057023f3884dbad1d4ebfba.json | Add setOverrideMimeType() to XHRLoader (#9959)
* Add setOverrideMimeType() to XHRLoader
* Rename setOverrideMimeType with setMimeType of FileLoader | src/loaders/FileLoader.js | @@ -184,7 +184,7 @@ Object.assign( FileLoader.prototype, {
if ( this.responseType !== undefined ) request.responseType = this.responseType;
if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
- if ( request.overrideMimeType ) request.overrideMimeType( 'text/plain' );
+ if ( request.overrideMimeType ) request.overrideMimeType( this.mimeType !== undefined ? this.mimeType : 'text/plain' );
request.send( null );
@@ -215,6 +215,13 @@ Object.assign( FileLoader.prototype, {
this.withCredentials = value;
return this;
+ },
+
+ setMimeType: function ( value ) {
+
+ this.mimeType = value;
+ return this;
+
}
} ); | false |
Other | mrdoob | three.js | effcd4402a20e60222dabe9e861ddd805ae4dfd5.json | stop sharing of Uniforms() in FilmPass | examples/js/postprocessing/FilmPass.js | @@ -21,10 +21,13 @@ THREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount,
} );
- if ( grayscale !== undefined ) this.uniforms.grayscale.value = grayscale;
- if ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity;
- if ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity;
- if ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount;
+ this.uniforms[ "tDiffuse" ] = new THREE.Uniform();
+ this.uniforms[ "time" ] = new THREE.Uniform();
+
+ if ( grayscale !== undefined ) this.uniforms.grayscale = new THREE.Uniform( grayscale );
+ if ( noiseIntensity !== undefined ) this.uniforms.nIntensity = new THREE.Uniform( noiseIntensity );
+ if ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity = new THREE.Uniform( scanlinesIntensity );
+ if ( scanlinesCount !== undefined ) this.uniforms.sCount = new THREE.Uniform( scanlinesCount );
this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
this.scene = new THREE.Scene(); | false |
Other | mrdoob | three.js | b01a230aa98d74d2b6bd1d903623a86194b2b767.json | fix uniforms that need unsharing for outline pass | examples/js/postprocessing/OutlinePass.js | @@ -59,11 +59,11 @@ THREE.OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
var MAX_EDGE_GLOW = 4;
this.separableBlurMaterial1 = this.getSeperableBlurMaterial(MAX_EDGE_THICKNESS);
- this.separableBlurMaterial1.uniforms[ "texSize" ].value = new THREE.Vector2(resx, resy);
- this.separableBlurMaterial1.uniforms[ "kernelRadius" ].value = 1;
+ this.separableBlurMaterial1.uniforms[ "texSize" ] = new THREE.Uniform( new THREE.Vector2(resx, resy) );
+ this.separableBlurMaterial1.uniforms[ "kernelRadius" ] = new THREE.Uniform( 1 );
this.separableBlurMaterial2 = this.getSeperableBlurMaterial(MAX_EDGE_GLOW);
- this.separableBlurMaterial2.uniforms[ "texSize" ].value = new THREE.Vector2(Math.round(resx/2), Math.round(resy/2));
- this.separableBlurMaterial2.uniforms[ "kernelRadius" ].value = MAX_EDGE_GLOW;
+ this.separableBlurMaterial2.uniforms[ "texSize" ] = new THREE.Uniform(new THREE.Vector2(Math.round(resx/2), Math.round(resy/2) ) );
+ this.separableBlurMaterial2.uniforms[ "kernelRadius" ] = new THREE.Uniform( MAX_EDGE_GLOW) ;
// Overlay material
this.overlayMaterial = this.getOverlayMaterial();
@@ -127,15 +127,15 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
this.renderTargetMaskDownSampleBuffer.setSize(resx, resy );
this.renderTargetBlurBuffer1.setSize(resx, resy );
this.renderTargetEdgeBuffer1.setSize(resx, resy );
- this.separableBlurMaterial1.uniforms[ "texSize" ].value = new THREE.Vector2(resx, resy);
+ this.separableBlurMaterial1.uniforms[ "texSize" ] = new THREE.Uniform( new THREE.Vector2(resx, resy) );
- resx = Math.round(resx/2);
- resy = Math.round(resy/2);
+ resx = Math.round(resx/2);
+ resy = Math.round(resy/2);
this.renderTargetBlurBuffer2.setSize(resx, resy );
this.renderTargetEdgeBuffer2.setSize(resx, resy );
- this.separableBlurMaterial2.uniforms[ "texSize" ].value = new THREE.Vector2(resx, resy);
+ this.separableBlurMaterial2.uniforms[ "texSize" ] = new THREE.Uniform( new THREE.Vector2(resx, resy) );
},
changeVisibilityOfSelectedObjects: function( bVisible ) { | false |
Other | mrdoob | three.js | 6f995385f5a7d6360bf694c10c5f934d6c92665d.json | fix manual MSAA | examples/js/postprocessing/ManualMSAARenderPass.js | @@ -87,7 +87,7 @@ THREE.ManualMSAARenderPass.prototype = Object.assign( Object.create( THREE.Pass.
var baseSampleWeight = 1.0 / jitterOffsets.length;
var roundingRange = 1 / 32;
- this.copyUniforms[ "tDiffuse" ].value = this.sampleRenderTarget.texture;
+ this.copyUniforms[ "tDiffuse" ] = new THREE.Uniform( this.sampleRenderTarget.texture );
var width = readBuffer.width, height = readBuffer.height;
@@ -110,7 +110,7 @@ THREE.ManualMSAARenderPass.prototype = Object.assign( Object.create( THREE.Pass.
sampleWeight += roundingRange * uniformCenteredDistribution;
}
- this.copyUniforms[ "opacity" ].value = sampleWeight;
+ this.copyUniforms[ "opacity" ] = new THREE.Uniform( sampleWeight );
renderer.setClearColor( this.clearColor, this.clearAlpha );
renderer.render( this.scene, this.camera, this.sampleRenderTarget, true );
if (i === 0) { | false |
Other | mrdoob | three.js | 66bdaf5a00e4346a2e5e3a735ce913432cba4c28.json | use new Uniform() instead of object literals | examples/js/Mirror.js | @@ -5,9 +5,9 @@
THREE.ShaderLib[ 'mirror' ] = {
uniforms: {
- "mirrorColor": { value: new THREE.Color( 0x7F7F7F ) },
- "mirrorSampler": { value: null },
- "textureMatrix" : { value: new THREE.Matrix4() }
+ "mirrorColor": new THREE.Uniform( new THREE.Color( 0x7F7F7F ) ),
+ "mirrorSampler": new THREE.Uniform( null ),
+ "textureMatrix" : new THREE.Uniform( new THREE.Matrix4() )
},
vertexShader: [
| false |
Other | mrdoob | three.js | d9f437b84fa116a48908e20913cb15303802bb06.json | Fix MMD audio example | examples/js/loaders/MMDLoader.js | @@ -2000,7 +2000,7 @@ THREE.MMDAudioManager = function ( audio, listener, p ) {
this.currentTime = 0.0;
this.delayTime = params.delayTime !== undefined ? params.delayTime : 0.0;
- this.audioDuration = this.audio.source.buffer.duration;
+ this.audioDuration = this.audio.buffer.duration;
this.duration = this.audioDuration + this.delayTime;
}; | false |
Other | mrdoob | three.js | 4ce415a6a8f2c5bcfc89434ada4e0529dd85fe69.json | Make Color.setScalar returns this. (#9885) | src/math/Color.js | @@ -53,6 +53,8 @@ Color.prototype = {
this.g = scalar;
this.b = scalar;
+ return this;
+
},
setHex: function ( hex ) { | false |
Other | mrdoob | three.js | f039ee722c9a16e5d6f24b57d005f8293394fd92.json | Add empty map to glsl plugin (#9745)
That is how it should look like according to rollup plugin conventions: https://github.com/rollup/rollup/wiki/Plugins | rollup.config.js | @@ -12,12 +12,16 @@ function glsl () {
transform ( code, id ) {
if ( !/\.glsl$/.test( id ) ) return;
- return 'export default ' + JSON.stringify(
+ var transformedCode = 'export default ' + JSON.stringify(
code
.replace( /[ \t]*\/\/.*\n/g, '' )
.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' )
.replace( /\n{2,}/g, '\n' )
) + ';';
+ return {
+ code: transformedCode,
+ map: { mappings: '' }
+ }
}
};
} | false |
Other | mrdoob | three.js | ba347be773d0226a01e99940b6cc4b755c3d662a.json | Add attributes to EditorControls (#9819)
* Add attributes to EditorControls
Add attributes to EditorControls to be able to change speed of controls
* Changed attribute name factor to speed | examples/js/controls/EditorControls.js | @@ -13,6 +13,9 @@ THREE.EditorControls = function ( object, domElement ) {
this.enabled = true;
this.center = new THREE.Vector3();
+ this.panSpeed = 0.001
+ this.zoomSpeed = 0.001
+ this.rotationSpeed = 0.005
// internals
@@ -57,7 +60,7 @@ THREE.EditorControls = function ( object, domElement ) {
var distance = object.position.distanceTo( center );
- delta.multiplyScalar( distance * 0.001 );
+ delta.multiplyScalar( distance * this.panSpeed );
delta.applyMatrix3( normalMatrix.getNormalMatrix( object.matrix ) );
object.position.add( delta );
@@ -71,7 +74,7 @@ THREE.EditorControls = function ( object, domElement ) {
var distance = object.position.distanceTo( center );
- delta.multiplyScalar( distance * 0.001 );
+ delta.multiplyScalar( distance * this.zoomSpeed );
if ( delta.length() > distance ) return;
@@ -144,7 +147,7 @@ THREE.EditorControls = function ( object, domElement ) {
if ( state === STATE.ROTATE ) {
- scope.rotate( new THREE.Vector3( - movementX * 0.005, - movementY * 0.005, 0 ) );
+ scope.rotate( new THREE.Vector3( - movementX * this.rotationSpeed, - movementY * this.rotationSpeed, 0 ) );
} else if ( state === STATE.ZOOM ) {
@@ -267,7 +270,7 @@ THREE.EditorControls = function ( object, domElement ) {
case 1:
touches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );
touches[ 1 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );
- scope.rotate( touches[ 0 ].sub( getClosest( touches[ 0 ], prevTouches ) ).multiplyScalar( - 0.005 ) );
+ scope.rotate( touches[ 0 ].sub( getClosest( touches[ 0 ], prevTouches ) ).multiplyScalar( - this.rotationSpeed ) );
break;
case 2: | false |
Other | mrdoob | three.js | ce50b6c0cdd50ec1fe380704aa1efec07a16b419.json | remove redundant checks (#9829) | src/renderers/WebGLRenderer.js | @@ -986,7 +986,7 @@ function WebGLRenderer( parameters ) {
var size = geometryAttribute.itemSize;
var buffer = objects.getAttributeBuffer( geometryAttribute );
- if ( geometryAttribute && geometryAttribute.isInterleavedBufferAttribute ) {
+ if ( geometryAttribute.isInterleavedBufferAttribute ) {
var data = geometryAttribute.data;
var stride = data.stride;
@@ -1013,7 +1013,7 @@ function WebGLRenderer( parameters ) {
} else {
- if ( geometryAttribute && geometryAttribute.isInstancedBufferAttribute ) {
+ if ( geometryAttribute.isInstancedBufferAttribute ) {
state.enableAttributeAndDivisor( programAttribute, geometryAttribute.meshPerAttribute, extension );
| false |
Other | mrdoob | three.js | cad8c07feb9389b3841da5e2e6b6a09f8cebad41.json | Add background property to Scene docs (#9817) | docs/api/scenes/Scene.html | @@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
@@ -26,18 +26,23 @@ <h3>[name]()</h3>
<h2>Properties</h2>
<h3>[property:Fog fog]</h3>
-
+
<div>A [page:Fog fog] instance defining the type of fog that affects everything rendered in the scene. Default is null.</div>
-
+
<h3>[property:Material overrideMaterial]</h3>
-
+
<div>If not null, it will force everything in the scene to be rendered with that material. Default is null.</div>
-
+
<h3>[property:boolean autoUpdate]</h3>
<div>
- Default is true. If set, then the renderer checks every frame if the scene and its objects needs matrix updates.
- When it isn't, then you have to maintain all matrices in the scene yourself.
- </div>
+ Default is true. If set, then the renderer checks every frame if the scene and its objects needs matrix updates.
+ When it isn't, then you have to maintain all matrices in the scene yourself.
+ </div>
+
+ <h3>[property:Object background]</h3>
+ <div>
+ If not null, sets the background used when rendering the scene, and is always rendered first. Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, or a [page:CubeTexture]. Default is null.
+ </div>
<h2>Methods</h2>
| false |
Other | mrdoob | three.js | 14717cfa40713635b27c2b62c61ce1d3d97f48e8.json | Add jsfiddle link to ISSUE_TEMPLATE.md | .github/ISSUE_TEMPLATE.md | @@ -2,6 +2,12 @@
##### Description of the problem
+Describe the problem/request in detail.
+Code snippet, screenshot, and small-test help us understand.
+
+You can edit for small-test.
+http://jsfiddle.net/akmcv7Lh/ (current revision)
+http://jsfiddle.net/hw9rcLL8/ (dev)
##### Three.js version
| false |
Other | mrdoob | three.js | d0dddebb5000f81a58c985320daa5e4cb2f23e49.json | Fix minor syntax error
Also, removed unnecessary tag <thead> | docs/api/lights/Light.html | @@ -1,81 +1,79 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
+<!DOCTYPE html>
+<html lang="en">
+ <head>
<meta charset="utf-8" />
- <base href="../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- [page:Object3D] →
-
- <h1>[name]</h1>
-
- <div class="desc">
- Abstract base class for lights - all other light types inherit the properties and methods
- described here.
- </div>
-
-
- <h2>Constructor</h2>
-
-
- <h3>[name]( [page:Integer color], [page:float intensity] )</h3>
- <div>
- [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
- [page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
-
- Creates a new [name]. Note that this is not intended to be called directly (use one of <thead>
- derived classes instead).
- </thead>)
- </div>
-
- <h2>Properties</h2>
- <div>
- See the base [page:Object3D Object3D] class for common properties.
- </div>
-
- <h3>[property:Color color]</h3>
- <div>
- Color of the light. Defaults to a new [page:Color] set to white, if not passed in the constructor.<br />
- </div>
-
- <h3>[property:Float intensity]</h3>
- <div>
- The light's intensity, or strength.<br />
- In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the product of
- [page:.color color] * intensity is interpreted as luminous intensity measured in candela.<br />
- Default - *1.0*.
- </div>
-
- <h3>[property:Boolean isLight]</h3>
- <div>
- Used to check whether this or derived classes are lights. Default is *true*.<br /><br />
-
- You should not change this, as it used internally for optimisation.
- </div>
-
-
- <h2>Methods</h2>
- <div>
- See the base [page:Object3D Object3D] class for common methods.
- </div>
-
-
- <h3>[method:Light copy]( [page:Light source] )</h3>
- <div>
- Copies the value of [page:.color color] and [page:.intensity intensity] from the
- [page:Light source] light into this one.
- </div>
-
- <h3>[method:JSON toJSON]( [page:String meta] )</h3>
- <div>
- Return Light data in JSON format.
- </div>
-
- <h2>Source</h2>
-
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
-</html>
+ <base href="../../" />
+ <script src="list.js"></script>
+ <script src="page.js"></script>
+ <link type="text/css" rel="stylesheet" href="page.css" />
+ </head>
+ <body>
+ [page:Object3D] →
+
+ <h1>[name]</h1>
+
+ <div class="desc">
+ Abstract base class for lights - all other light types inherit the properties and methods
+ described here.
+ </div>
+
+
+ <h2>Constructor</h2>
+
+
+ <h3>[name]( [page:Integer color], [page:float intensity] )</h3>
+ <div>
+ [page:Integer color] - (optional) hexadecimal color of the light. Default is 0xffffff (white).<br />
+ [page:Float intensity] - (optional) numeric value of the light's strength/intensity. Default is 1.<br /><br />
+
+ Creates a new [name]. Note that this is not intended to be called directly (use one of derived classes instead).
+ </div>
+
+ <h2>Properties</h2>
+ <div>
+ See the base [page:Object3D Object3D] class for common properties.
+ </div>
+
+ <h3>[property:Color color]</h3>
+ <div>
+ Color of the light. Defaults to a new [page:Color] set to white, if not passed in the constructor.<br />
+ </div>
+
+ <h3>[property:Float intensity]</h3>
+ <div>
+ The light's intensity, or strength.<br />
+ In [page:WebGLRenderer.physicallyCorrectLights physically correct] mode, the product of
+ [page:.color color] * intensity is interpreted as luminous intensity measured in candela.<br />
+ Default - *1.0*.
+ </div>
+
+ <h3>[property:Boolean isLight]</h3>
+ <div>
+ Used to check whether this or derived classes are lights. Default is *true*.<br /><br />
+
+ You should not change this, as it used internally for optimisation.
+ </div>
+
+
+ <h2>Methods</h2>
+ <div>
+ See the base [page:Object3D Object3D] class for common methods.
+ </div>
+
+
+ <h3>[method:Light copy]( [page:Light source] )</h3>
+ <div>
+ Copies the value of [page:.color color] and [page:.intensity intensity] from the
+ [page:Light source] light into this one.
+ </div>
+
+ <h3>[method:JSON toJSON]( [page:String meta] )</h3>
+ <div>
+ Return Light data in JSON format.
+ </div>
+
+ <h2>Source</h2>
+
+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+ </body>
+</html>
| false |
Other | mrdoob | three.js | f344d8fe97ead056131f31d96a1b20019c1e32cd.json | Fix a bug in 3MFLoader | examples/js/loaders/3MFLoader.js | @@ -418,10 +418,10 @@ THREE.ThreeMFLoader.prototype = {
} );
var mat4 = new THREE.Matrix4();
buildItem[ 'transform' ] = mat4.set(
- t[ 0 ], t[ 1 ], t[ 2 ], 0.0,
- t[ 3 ], t[ 4 ], t[ 5 ], 0.0,
- t[ 6 ], t[ 7 ], t[ 8 ], 0.0,
- t[ 9 ], t[ 10 ], t[ 11 ], 1.0
+ t[ 0 ], t[ 3 ], t[ 6 ], t[ 9 ],
+ t[ 1 ], t[ 4 ], t[ 7 ], t[ 10 ],
+ t[ 2 ], t[ 5 ], t[ 8 ], t[ 11 ],
+ 0.0, 0.0, 0.0, 1.0
);
} | false |
Other | mrdoob | three.js | 22be147ddf96b2276800e48bb2c8d16ec3cc1845.json | Fix typo in FaceNormalsHelper | docs/api/helpers/FaceNormalsHelper.html | @@ -32,7 +32,7 @@ <h2>Example</h2>
helper = new THREE.FaceNormalsHelper( box, 2, 0x00ff00, 1 );
- scene.add( object );
+ scene.add( box );
scene.add( helper );
</code>
| false |
Other | mrdoob | three.js | ea4c461c1d935da5498bf1974f56518941b629e9.json | fix typos and syntax errors | docs/manual/introduction/How-to-update-things.html | @@ -10,7 +10,7 @@
<body>
<h1>[name]</h1>
<div>
- <p>All objects by default automatically update their matrices if the have been added to the scene with</p>
+ <p>All objects by default automatically update their matrices if they have been added to the scene with</p>
<code>
var object = new THREE.Object3D;
scene.add( object );
@@ -44,8 +44,8 @@ <h3>[page:BufferGeometry]</h3>
work with.
</p>
<p>
- With regards to updating BufferGeometries, the most important thing to understand is that you
- you cannot resize buffers (this is very costly, basically the equivalent to creating new a geometry).
+ With regards to updating BufferGeometries, the most important thing to understand is that
+ you cannot resize buffers (this is very costly, basically the equivalent to creating a new geometry).
You can however update the content of buffers.
</p>
<p> | false |
Other | mrdoob | three.js | b3ef1ffc7a0b25a47502f99fc29baa4c49faf8d9.json | fix minor errors for better syntax | docs/manual/introduction/How-to-run-thing-locally.html | @@ -26,10 +26,10 @@ <h2>Content loaded from external files</h2>
<ol>
<li>
- Change security for local files in a browser (this allows you to access your page as <code>file:///yourFile.html</code>
+ Change security for local files in a browser, this allows you to access your page as <code>file:///yourFile.html</code>
</li>
<li>
- Run files from a local web server (this allows you to access your page as <code>http://localhost/yourFile.html</code>
+ Run files from a local web server, this allows you to access your page as <code>http://localhost/yourFile.html</code>
</li>
</ol>
@@ -165,7 +165,6 @@ <h4>Running lighttpd on Mac</h4>
<li>
Create a configuration file called lighttpd.conf in the directory where you want to run
your webserver. There is a sample [link:http://redmine.lighttpd.net/projects/lighttpd/wiki/TutorialConfiguration here].
- page.
</li>
<li>
In the conf file, change the server.document-root to the directory you want to serve files from. | false |
Other | mrdoob | three.js | 3368da40711f4b01816987f7baa73a627187684a.json | fix syntax errors and typo | docs/api/lights/DirectionalLight.html | @@ -13,7 +13,7 @@
<h1>[name]</h1>
<div class="desc">
- A light that gets emitted in a specific direction. This light will behave as though it is
+ A light that gets emitted in a specific direction. This light will behave as though it is
infinitely far away and the rays produced from it are all parallel. The common use case
for this is to simulate daylight; the sun is far enough away that its position can be
considered to be infinite, and all light rays coming from it are parallel.<br /><br />
@@ -29,7 +29,7 @@ <h2>A Note about Position, Target and rotation</h2>
This means that its direction is calculated as pointing
from the light's [page:Object3D.position position] to the [page:.target target]'s position
- (as opposed to a a 'Free Direct Light' that just has a rotation component).<br /><br />
+ (as opposed to a 'Free Direct Light' that just has a rotation component).<br /><br />
The reason for this is to allow the light to cast shadows - the [page:.shadow shadow]
camera needs a position to calculate shadows from.<br /><br />
@@ -81,9 +81,9 @@ <h3>[property:Boolean castShadow]</h3>
<h3>[property:Boolean isDirectionalLight]</h3>
<div>
- Used to check whether this or derived classes are dircrectional lights. Default is *true*.<br /><br />
+ Used to check whether this or derived classes are directional lights. Default is *true*.<br /><br />
- You should not change this, as it used internally for optimisation.
+ You should not change this, as it is used internally for optimisation.
</div>
| false |
Other | mrdoob | three.js | 2e3a2923a65ac2db045d19676da711a95d022ac6.json | Fix a bug in 3MFLoader | examples/js/loaders/3MFLoader.js | @@ -418,10 +418,10 @@ THREE.ThreeMFLoader.prototype = {
} );
var mat4 = new THREE.Matrix4();
buildItem[ 'transform' ] = mat4.set(
- t[ 0 ], t[ 1 ], t[ 2 ], 0.0,
- t[ 3 ], t[ 4 ], t[ 5 ], 0.0,
- t[ 6 ], t[ 7 ], t[ 8 ], 0.0,
- t[ 9 ], t[ 10 ], t[ 11 ], 1.0
+ t[ 0 ], t[ 3 ], t[ 6 ], t[ 9 ],
+ t[ 1 ], t[ 4 ], t[ 7 ], t[ 10 ],
+ t[ 2 ], t[ 5 ], t[ 8 ], t[ 11 ],
+ 0.0, 0.0, 0.0, 1.0
);
} | false |
Other | mrdoob | three.js | 4560873844f1f43caf856dcc38cb97283b4754d9.json | add more monkeys | examples/webgl_performance.html | @@ -57,9 +57,9 @@
geometry.computeVertexNormals();
- for ( var i = 0; i < 20; i ++ ) {
- for ( var j = 0; j < 20; j ++ ) {
- for ( var k = 0; k < 20; k ++ ) {
+ for ( var i = 0; i < 25; i ++ ) {
+ for ( var j = 0; j < 25; j ++ ) {
+ for ( var k = 0; k < 25; k ++ ) {
var mesh = new THREE.Mesh( geometry, material );
| false |
Other | mrdoob | three.js | a1c3086f56eb750cf9b371f4f3b709051d9a86cd.json | add aspect in toPerspective(). update doc | docs/examples/cameras/CombinedCamera.html | @@ -52,6 +52,9 @@ <h3>[property:Number fov]</h3>
Gets or sets the camera frustum vertical field of view in perspective view.
</div>
+ <h3>[property:Float aspect]</h3>
+ <div>Camera frustum aspect ratio, usually the canvas width / canvas height.</div>
+
<h3>[property:number left]</h3>
<div>
Gets or sets the camera frustum left plane in orthographic view.
@@ -87,6 +90,13 @@ <h3>[property:number far]</h3>
Gets camera frustum far plane.
</div>
+ <h3>[property:Object view]</h3>
+ <div>
+ Frustum window specification or null.
+ This is set using the [page:CombinedCamera.setViewOffset .setViewOffset] method
+ and cleared using [page:CombinedCamera.clearViewOffset .clearViewOffset].
+ </div>
+
<h3>[property:Matrix4 projectionMatrix]</h3>
<div>
This is the matrix which contains the projection.
@@ -193,6 +203,30 @@ <h3>[method:null updateProjectionMatrix]()</h3>
Updates the ProjectionMatrix.
</div>
+ <h3>[method:Camera copy]( [page:Camera source] )</h3>
+ <div>
+ Copy the properties from the source camera into this one.
+ </div>
+
+ <h3>[method:null setViewOffset]( [page:Float fullWidth], [page:Float fullHeight], [page:Float x], [page:Float y], [page:Float width], [page:Float height] )</h3>
+ <div>
+ fullWidth — full width of multiview setup<br />
+ fullHeight — full height of multiview setup<br />
+ x — horizontal offset of subcamera<br />
+ y — vertical offset of subcamera<br />
+ width — width of subcamera<br />
+ height — height of subcamera<br /><br />
+
+ Sets an offset in a larger [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
+ This is useful for multi-window or multi-monitor/multi-machine setups.
+ For an example on how to use it see [page:PerspectiveCamera.setViewOffset PerspectiveCamera].
+ </div>
+
+
+ <h3>[method:null clearViewOffset]()</h3>
+ <div>
+ Removes any offset set by the .setViewOffset method.
+ </div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/cameras/CombinedCamera.js examples/cameras/CombinedCamera.js] | true |
Other | mrdoob | three.js | a1c3086f56eb750cf9b371f4f3b709051d9a86cd.json | add aspect in toPerspective(). update doc | examples/js/cameras/CombinedCamera.js | @@ -45,6 +45,7 @@ THREE.CombinedCamera.prototype.toPerspective = function () {
this.near = this.cameraP.near;
this.far = this.cameraP.far;
+ this.cameraP.aspect = this.aspect;
this.cameraP.fov = this.fov / this.zoom ;
this.cameraP.view = this.view;
| true |
Other | mrdoob | three.js | 5e149ae75e6e3ab518d0c30c9808d28a36c74b01.json | add setView clearView functions | examples/js/cameras/CombinedCamera.js | @@ -123,6 +123,39 @@ THREE.CombinedCamera.prototype.copy = function ( source ) {
return this;
};
+
+THREE.CombinedCamera.prototype.setViewOffset = function( fullWidth, fullHeight, x, y, width, height ) {
+
+ this.view = {
+ fullWidth: fullWidth,
+ fullHeight: fullHeight,
+ offsetX: x,
+ offsetY: y,
+ width: width,
+ height: height
+ };
+
+ if ( this.inPerspectiveMode ) {
+
+ this.aspect = fullWidth / fullHeight;
+
+ this.toPerspective();
+
+ } else {
+
+ this.toOrthographic();
+
+ }
+
+};
+
+THREE.CombinedCamera.prototype.clearViewOffset = function() {
+
+ this.view = null;
+ this.updateProjectionMatrix();
+
+};
+
THREE.CombinedCamera.prototype.setSize = function( width, height ) {
this.cameraP.aspect = width / height; | false |
Other | mrdoob | three.js | cf70dd04a7b3f6c16d6a16b927d898ec8da10246.json | add copy function | examples/js/cameras/CombinedCamera.js | @@ -97,7 +97,32 @@ THREE.CombinedCamera.prototype.toOrthographic = function () {
};
+THREE.CombinedCamera.prototype.copy = function ( source ) {
+ THREE.Camera.prototype.copy.call( this, source );
+
+ this.fov = source.fov;
+ this.far = source.far;
+ this.near = source.near;
+
+ this.left = source.left;
+ this.right = source.right;
+ this.top = source.top;
+ this.bottom = source.bottom;
+
+ this.zoom = source.zoom;
+ this.view = source.view === null ? null : Object.assign( {}, source.view );
+ this.aspect = source.aspect;
+
+ this.cameraO = source.cameraO.copy();
+ this.cameraP = source.cameraP.copy();
+
+ this.inOrthographicMode = source.inOrthographicMode;
+ this.inPerspectiveMode = source.inPerspectiveMode;
+
+ return this;
+
+};
THREE.CombinedCamera.prototype.setSize = function( width, height ) {
this.cameraP.aspect = width / height; | false |
Other | mrdoob | three.js | f3d81414ad7678b08b561de7824067aa1c7dcca0.json | Fix typo in FaceNormalsHelper | docs/api/helpers/FaceNormalsHelper.html | @@ -32,7 +32,7 @@ <h2>Example</h2>
helper = new THREE.FaceNormalsHelper( box, 2, 0x00ff00, 1 );
- scene.add( object );
+ scene.add( box );
scene.add( helper );
</code>
| false |
Other | mrdoob | three.js | 3944b9b1b7a199e19756fe6b54debd65431361f1.json | fix typos and syntax errors | docs/manual/introduction/How-to-update-things.html | @@ -10,7 +10,7 @@
<body>
<h1>[name]</h1>
<div>
- <p>All objects by default automatically update their matrices if the have been added to the scene with</p>
+ <p>All objects by default automatically update their matrices if they have been added to the scene with</p>
<code>
var object = new THREE.Object3D;
scene.add( object );
@@ -44,8 +44,8 @@ <h3>[page:BufferGeometry]</h3>
work with.
</p>
<p>
- With regards to updating BufferGeometries, the most important thing to understand is that you
- you cannot resize buffers (this is very costly, basically the equivalent to creating new a geometry).
+ With regards to updating BufferGeometries, the most important thing to understand is that
+ you cannot resize buffers (this is very costly, basically the equivalent to creating a new geometry).
You can however update the content of buffers.
</p>
<p> | false |
Other | mrdoob | three.js | 5ce0b3038adee3891d4efdb30a0620a3e729c1fd.json | fix minor errors for better syntax | docs/manual/introduction/How-to-run-thing-locally.html | @@ -26,10 +26,10 @@ <h2>Content loaded from external files</h2>
<ol>
<li>
- Change security for local files in a browser (this allows you to access your page as <code>file:///yourFile.html</code>
+ Change security for local files in a browser, this allows you to access your page as <code>file:///yourFile.html</code>
</li>
<li>
- Run files from a local web server (this allows you to access your page as <code>http://localhost/yourFile.html</code>
+ Run files from a local web server, this allows you to access your page as <code>http://localhost/yourFile.html</code>
</li>
</ol>
@@ -165,7 +165,6 @@ <h4>Running lighttpd on Mac</h4>
<li>
Create a configuration file called lighttpd.conf in the directory where you want to run
your webserver. There is a sample [link:http://redmine.lighttpd.net/projects/lighttpd/wiki/TutorialConfiguration here].
- page.
</li>
<li>
In the conf file, change the server.document-root to the directory you want to serve files from. | false |
Other | mrdoob | three.js | c60e9b321c05e5b55767ad797dac7d93d60c5111.json | Remove unnecessary lines | examples/webgl_multiple_elements_text.html | @@ -249,7 +249,6 @@
renderer.setScissor( left, bottom, width, height );
renderer.render( scene, scene.userData.camera );
- scene.userData.controls.update();
for ( var i = 0 ; i < scene.children[0].geometry.vertices.length ; i++ ) {
@@ -432,10 +431,6 @@
</div>
- <div class="math">
-
- </div>
-
<p>Here is a cylindrical wave moving on a three-dimensional lattice of atoms:</p>
<div class="view"> | false |
Other | mrdoob | three.js | 5e6aefce5f6c39b07ef553330c4a5d0abe33d86e.json | Set explicit clear color for iOS (#9297) | docs/scenes/bones-browser.html | @@ -59,6 +59,7 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
+ renderer.setClearColor( 0x000000 );
document.body.appendChild( renderer.domElement );
orbit = new THREE.OrbitControls( camera, renderer.domElement ); | true |
Other | mrdoob | three.js | 5e6aefce5f6c39b07ef553330c4a5d0abe33d86e.json | Set explicit clear color for iOS (#9297) | docs/scenes/geometry-browser.html | @@ -52,6 +52,7 @@
var renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
+ renderer.setClearColor( 0x000000 );
document.body.appendChild( renderer.domElement );
var orbit = new THREE.OrbitControls( camera, renderer.domElement ); | true |
Other | mrdoob | three.js | 5e6aefce5f6c39b07ef553330c4a5d0abe33d86e.json | Set explicit clear color for iOS (#9297) | docs/scenes/material-browser.html | @@ -50,6 +50,7 @@
var renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
+ renderer.setClearColor( 0x000000 );
document.body.appendChild( renderer.domElement );
var ambientLight = new THREE.AmbientLight( 0x000000 ); | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/BoxBufferGeometry.html | @@ -14,7 +14,23 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:BoxGeometry].</div>
- <iframe src='scenes/geometry-browser.html#BoxBufferGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#BoxBufferGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -26,7 +42,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:Integer widthSegments], [page:Integer heightSegments], [page:Integer depthSegments])</h3>
<div>
width — Width of the sides on the X axis.<br />
@@ -37,7 +52,6 @@ <h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:In
depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1.
</div>
-
<h2>Properties</h2>
<h3>.parameters</h3> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/CircleBufferGeometry.html | @@ -14,9 +14,25 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:CircleGeometry].</div>
- <h2>Example</h2>
+ <iframe id="scene" src="scenes/geometry-browser.html#CircleBufferGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
- <iframe src='scenes/geometry-browser.html#CircleBufferGeometry'></iframe>
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>
var geometry = new THREE.CircleBufferGeometry( 5, 32 );
@@ -25,7 +41,6 @@ <h2>Example</h2>
scene.add( circle );
</code>
-
<h2>Constructor</h2>
<h3>[name]([page:Float radius], [page:Integer segments], [page:Float thetaStart], [page:Float thetaLength])</h3>
@@ -36,7 +51,6 @@ <h3>[name]([page:Float radius], [page:Integer segments], [page:Float thetaStart]
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete circle.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/CircleGeometry.html | @@ -15,9 +15,25 @@ <h1>[name]</h1>
<div class="desc">CircleGeometry is a simple shape of Euclidean geometry. It is contructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius. It is built counter-clockwise from a start angle and a given central angle. It can also be used to create regular polygons, where the number of segments determines the number of sides.
</div>
- <h2>Example</h2>
+ <iframe id="scene" src="scenes/geometry-browser.html#CircleGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
- <iframe src='scenes/geometry-browser.html#CircleGeometry'></iframe>
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>
var geometry = new THREE.CircleGeometry( 5, 32 );
@@ -26,7 +42,6 @@ <h2>Example</h2>
scene.add( circle );
</code>
-
<h2>Constructor</h2>
<h3>[name]([page:Float radius], [page:Integer segments], [page:Float thetaStart], [page:Float thetaLength])</h3>
@@ -37,7 +52,6 @@ <h3>[name]([page:Float radius], [page:Integer segments], [page:Float thetaStart]
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete circle.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/ConeBufferGeometry.html | @@ -14,21 +14,34 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:ConeGeometry].</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#ConeBufferGeometry"></iframe>
- <h2>Example</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
- <iframe src='scenes/geometry-browser.html#ConeBufferGeometry'></iframe>
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.ConeBufferGeometry( 5, 20, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
var cone = new THREE.Mesh( geometry, material );
scene.add( cone );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
radius — Radius of the cone base. Default is 20.<br />
@@ -40,14 +53,12 @@ <h3>[name]([page:Float radius], [page:Float height], [page:Integer radiusSegment
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cone.
</div>
-
<h2>Properties</h2>
<div>
Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/ConeGeometry.html | @@ -14,21 +14,34 @@ <h1>[name]</h1>
<div class="desc">A class for generating cone geometries</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#ConeGeometry"></iframe>
- <h2>Example</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
- <iframe src='scenes/geometry-browser.html#ConeGeometry'></iframe>
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.ConeGeometry( 5, 20, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
var cone = new THREE.Mesh( geometry, material );
scene.add( cone );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
radius — Radius of the cone at the base. Default is 20.<br />
@@ -40,14 +53,12 @@ <h3>[name]([page:Float radius], [page:Float height], [page:Integer radiusSegment
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cone.
</div>
-
<h2>Properties</h2>
<div>
Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/CylinderBufferGeometry.html | @@ -14,21 +14,34 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:CylinderGeometry].</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#CylinderBufferGeometry"></iframe>
- <h2>Example</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
- <iframe src='scenes/geometry-browser.html#CylinderBufferGeometry'></iframe>
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.CylinderBufferGeometry( 5, 5, 20, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
var cylinder = new THREE.Mesh( geometry, material );
scene.add( cylinder );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
radiusTop — Radius of the cylinder at the top. Default is 20.<br />
@@ -41,14 +54,12 @@ <h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cylinder.
</div>
-
<h2>Properties</h2>
<div>
Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/CylinderGeometry.html | @@ -14,21 +14,34 @@ <h1>[name]</h1>
<div class="desc">A class for generating cylinder geometries</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#CylinderGeometry"></iframe>
- <h2>Example</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
- <iframe src='scenes/geometry-browser.html#CylinderGeometry'></iframe>
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
var cylinder = new THREE.Mesh( geometry, material );
scene.add( cylinder );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height], [page:Integer radiusSegments], [page:Integer heightSegments], [page:Boolean openEnded], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
radiusTop — Radius of the cylinder at the top. Default is 20.<br />
@@ -41,14 +54,12 @@ <h3>[name]([page:Float radiusTop], [page:Float radiusBottom], [page:Float height
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cylinder.
</div>
-
<h2>Properties</h2>
<div>
Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/DodecahedronGeometry.html | @@ -14,27 +14,39 @@ <h1>[name]</h1>
<div class="desc">A class for generating a dodecahedron geometries.</div>
- <iframe src='scenes/geometry-browser.html#DodecahedronGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#DodecahedronGeometry"></iframe>
+ <script>
- <h2>Constructor</h2>
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]([page:Float radius], [page:Integer detail])</h3>
<div>
radius — Radius of the dodecahedron. Default is 1.<br />
detail — Default is 0. Setting this to a value greater than 0 adds vertices making it no longer a dodecahedron.
</div>
-
<h2>Properties</h2>
<h3>[property:Object parameters]</h3>
<div>
An object with all of the parameters that were used to generate the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/IcosahedronGeometry.html | @@ -13,26 +13,39 @@ <h1>[name]</h1>
<div class="desc">A class for generating an icosahedron geometry.</div>
- <iframe src='scenes/geometry-browser.html#IcosahedronGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#IcosahedronGeometry"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]([page:Float radius], [page:Integer detail])</h3>
<div>
radius — Default is 1. <br />
detail — Default is 0. Setting this to a value greater than 0 adds more vertices making it no longer an icosahedron. When detail is greater than 1, it's effectively a sphere.
</div>
-
<h2>Properties</h2>
<h3>[property:Object parameters]</h3>
<div>
An object with all of the parameters that were used to generate the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/LatheBufferGeometry.html | @@ -14,10 +14,25 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:LatheGeometry].</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#LatheBufferGeometry"></iframe>
- <h2>Example</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
- <iframe src='scenes/geometry-browser.html#LatheBufferGeometry'></iframe>
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>
var points = [];
@@ -32,7 +47,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
<div>
points — Array of Vector2s. The x-coordinate of each point must be greater than zero.<br />
@@ -44,7 +58,6 @@ <h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart],
This creates a LatheBufferGeometry based on the parameters.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/LatheGeometry.html | @@ -14,10 +14,25 @@ <h1>[name]</h1>
<div class="desc">Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Y axis.</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#LatheGeometry"></iframe>
- <h2>Example</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
- <iframe src='scenes/geometry-browser.html#LatheGeometry'></iframe>
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>
var points = [];
@@ -32,7 +47,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
<div>
points — Array of Vector2s. The x-coordinate of each point must be greater than zero.<br />
@@ -44,7 +58,6 @@ <h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart],
This creates a LatheBufferGeometry based on the parameters.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/OctahedronGeometry.html | @@ -13,18 +13,32 @@ <h1>[name]</h1>
<div class="desc">A class for generating an octahedron geometry.</div>
- <iframe src='scenes/geometry-browser.html#OctahedronGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#OctahedronGeometry"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]([page:Float radius], [page:Integer detail])</h3>
<div>
radius — Radius of the octahedron. Default is 1.<br />
detail — Default is 0. Setting this to a value greater than zero add vertices making it no longer an octahedron.
</div>
-
<h2>Properties</h2>
<h3>[property:Object parameters]</h3> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/PlaneBufferGeometry.html | @@ -14,20 +14,34 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:PlaneGeometry].</div>
- <h2>Example</h2>
+ <iframe id="scene" src="scenes/geometry-browser.html#PlaneBufferGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
- <iframe src='scenes/geometry-browser.html#PlaneBufferGeometry'></iframe>
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.PlaneBufferGeometry( 5, 20, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
var plane = new THREE.Mesh( geometry, material );
scene.add( plane );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float width], [page:Float height], [page:Integer widthSegments], [page:Integer heightSegments])</h3>
<div>
width — Width along the X axis.<br />
@@ -36,7 +50,6 @@ <h3>[name]([page:Float width], [page:Float height], [page:Integer widthSegments]
heightSegments — Optional. Default is 1.
</div>
-
<h2>Properties</h2>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/PlaneGeometry.html | @@ -14,21 +14,34 @@ <h1>[name]</h1>
<div class="desc">A class for generating plane geometries</div>
+ <iframe id="scene" src="scenes/geometry-browser.html#PlaneGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
- <iframe src='scenes/geometry-browser.html#PlaneGeometry'></iframe>
-
<code>var geometry = new THREE.PlaneGeometry( 5, 20, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00, side: THREE.DoubleSide} );
var plane = new THREE.Mesh( geometry, material );
scene.add( plane );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float width], [page:Float height], [page:Integer widthSegments], [page:Integer heightSegments])</h3>
<div>
width — Width along the X axis.<br />
@@ -37,7 +50,6 @@ <h3>[name]([page:Float width], [page:Float height], [page:Integer widthSegments]
heightSegments — Optional. Default is 1.
</div>
-
<h2>Properties</h2>
<div>
| true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/RingBufferGeometry.html | @@ -14,7 +14,23 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:RingGeometry].</div>
- <iframe src='scenes/geometry-browser.html#RingBufferGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#RingBufferGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -26,7 +42,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Float innerRadius], [page:Float outerRadius], [page:Integer thetaSegments], [page:Integer phiSegments], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
innerRadius — Default is 0, but it doesn't work right when innerRadius is set to 0.<br />
@@ -37,7 +52,6 @@ <h3>[name]([page:Float innerRadius], [page:Float outerRadius], [page:Integer the
thetaLength — Central angle. Default is Math.PI * 2.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/RingGeometry.html | @@ -14,7 +14,23 @@ <h1>[name]</h1>
<div class="desc">A class for generating a two-dimensional ring geometry.</div>
- <iframe src='scenes/geometry-browser.html#RingGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#RingGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -26,7 +42,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Float innerRadius], [page:Float outerRadius], [page:Integer thetaSegments], [page:Integer phiSegments], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
innerRadius — Default is 0, but it doesn't work right when innerRadius is set to 0.<br />
@@ -37,7 +52,6 @@ <h3>[name]([page:Float innerRadius], [page:Float outerRadius], [page:Integer the
thetaLength — Central angle. Default is Math.PI * 2.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/SphereBufferGeometry.html | @@ -14,9 +14,25 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:SphereGeometry].</div>
- <h2>Example</h2>
+ <iframe id="scene" src="scenes/geometry-browser.html#SphereBufferGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
- <iframe src='scenes/geometry-browser.html#SphereBufferGeometry'></iframe>
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.SphereBufferGeometry( 5, 32, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
@@ -26,7 +42,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Integer widthSegments], [page:Integer heightSegments], [page:Float phiStart], [page:Float phiLength], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
@@ -43,7 +58,6 @@ <h3>[name]([page:Float radius], [page:Integer widthSegments], [page:Integer heig
The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to <em>'sphere slices'</em>) can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices.
</div>
-
<h2>Properties</h2>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/SphereGeometry.html | @@ -14,9 +14,25 @@ <h1>[name]</h1>
<div class="desc">A class for generating sphere geometries</div>
- <h2>Example</h2>
+ <iframe id="scene" src="scenes/geometry-browser.html#SphereGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
- <iframe src='scenes/geometry-browser.html#SphereGeometry'></iframe>
+ }
+
+ </script>
+
+ <h2>Example</h2>
<code>var geometry = new THREE.SphereGeometry( 5, 32, 32 );
var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
@@ -26,7 +42,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Integer widthSegments], [page:Integer heightSegments], [page:Float phiStart], [page:Float phiLength], [page:Float thetaStart], [page:Float thetaLength])</h3>
<div>
@@ -43,7 +58,6 @@ <h3>[name]([page:Float radius], [page:Integer widthSegments], [page:Integer heig
The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to <em>'sphere slices'</em>) can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices.
</div>
-
<h2>Properties</h2>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/TetrahedronGeometry.html | @@ -14,27 +14,39 @@ <h1>[name]</h1>
<div class="desc">A class for generating a tetrahedron geometries.</div>
- <iframe src='scenes/geometry-browser.html#TetrahedronGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#TetrahedronGeometry"></iframe>
+ <script>
- <h2>Constructor</h2>
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]([page:Float radius], [page:Integer detail])</h3>
<div>
radius — Radius of the tetrahedron. Default is 1.<br />
detail — Default is 0. Setting this to a value greater than 0 adds vertices making it no longer a tetrahedron.
</div>
-
<h2>Properties</h2>
<h3>[property:Object parameters]</h3>
<div>
An object with all of the parameters that were used to generate the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/TextGeometry.html | @@ -14,9 +14,25 @@ <h1>[name]</h1>
<div class="desc">This object creates a 3D object of text as a single object.</div>
- <h2>Example</h2>
+ <iframe id="scene" src="scenes/geometry-browser.html#TextGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
- <iframe src='scenes/geometry-browser.html#TextGeometry'></iframe>
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Example</h2>
<div>
[example:webgl_geometry_text geometry / text ]<br/>
@@ -25,7 +41,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:String text], [page:Object parameters])</h3>
<div>
text — The text that needs to be shown. <br /> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/TorusBufferGeometry.html | @@ -14,7 +14,23 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:TorusGeometry].</div>
- <iframe src='scenes/geometry-browser.html#TorusBufferGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#TorusBufferGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -24,10 +40,8 @@ <h2>Example</h2>
scene.add( torus );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Float tube], [page:Integer radialSegments], [page:Integer tubularSegments], [page:Float arc])</h3>
<div>
radius — Default is 100. <br />
@@ -37,7 +51,6 @@ <h3>[name]([page:Float radius], [page:Float tube], [page:Integer radialSegments]
arc — Central angle. Default is Math.PI * 2.
</div>
-
<h2>Properties</h2>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/TorusGeometry.html | @@ -14,7 +14,23 @@ <h1>[name]</h1>
<div class="desc">A class for generating torus geometries</div>
- <iframe src='scenes/geometry-browser.html#TorusGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#TorusGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -24,10 +40,8 @@ <h2>Example</h2>
scene.add( torus );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Float tube], [page:Integer radialSegments], [page:Integer tubularSegments], [page:Float arc])</h3>
<div>
radius — Default is 100. <br />
@@ -37,7 +51,6 @@ <h3>[name]([page:Float radius], [page:Float tube], [page:Integer radialSegments]
arc — Central angle. Default is Math.PI * 2.
</div>
-
<h2>Properties</h2>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/TorusKnotBufferGeometry.html | @@ -14,8 +14,23 @@ <h1>[name]</h1>
<div class="desc">This is the [page:BufferGeometry] port of [page:TorusKnotGeometry].</div>
- <iframe src='scenes/geometry-browser.html#TorusKnotBufferGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#TorusKnotBufferGeometry"></iframe>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -25,10 +40,8 @@ <h2>Example</h2>
scene.add( torusKnot );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Float tube], [page:Integer tubularSegments], [page:Integer radialSegments], [page:Integer p], [page:Integer q])</h3>
<div>
<ul>
@@ -41,15 +54,12 @@ <h3>[name]([page:Float radius], [page:Float tube], [page:Integer tubularSegments
</ul>
</div>
-
<h2>Properties</h2>
-
<div>
Each of the contructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/extras/geometries/TorusKnotGeometry.html | @@ -14,8 +14,23 @@ <h1>[name]</h1>
<div class="desc">Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q. If p and q are not coprime, the result will be a torus link.</div>
- <iframe src='scenes/geometry-browser.html#TorusKnotGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#TorusKnotGeometry"></iframe>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -25,10 +40,8 @@ <h2>Example</h2>
scene.add( torusKnot );
</code>
-
<h2>Constructor</h2>
-
<h3>[name]([page:Float radius], [page:Float tube], [page:Integer tubularSegments], [page:Integer radialSegments], [page:Integer p], [page:Integer q])</h3>
<div>
<ul>
@@ -41,15 +54,12 @@ <h3>[name]([page:Float radius], [page:Float tube], [page:Integer tubularSegments
</ul>
</div>
-
<h2>Properties</h2>
-
<div>
Each of the contructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/materials/MeshBasicMaterial.html | @@ -15,10 +15,25 @@ <h1>[name]</h1>
<div class="desc">A material for drawing geometries in a simple shaded (flat or wireframe) way.</div>
<div class="desc">The default will render as flat polygons. To draw the mesh as wireframe, simply set the 'wireframe' property to true.</div>
- <iframe src='scenes/material-browser.html#MeshBasicMaterial'></iframe>
+ <iframe id="scene" src="scenes/material-browser.html#MeshBasicMaterial"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]( [page:Object parameters] )</h3>
| true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/materials/MeshDepthMaterial.html | @@ -14,10 +14,25 @@ <h1>[name]</h1>
<div class="desc">A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.</div>
- <iframe src='scenes/material-browser.html#MeshDepthMaterial'></iframe>
+ <iframe id="scene" src="scenes/material-browser.html#MeshDepthMaterial"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]( [page:Object parameters] )</h3>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/materials/MeshLambertMaterial.html | @@ -14,10 +14,25 @@ <h1>[name]</h1>
<div class="desc">A material for non-shiny (Lambertian) surfaces, evaluated per vertex.</div>
- <iframe src='scenes/material-browser.html#MeshLambertMaterial'></iframe>
+ <iframe id="scene" src="scenes/material-browser.html#MeshLambertMaterial"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]( [page:Object parameters] )</h3>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/materials/MeshNormalMaterial.html | @@ -14,11 +14,25 @@ <h1>[name]</h1>
<div class="desc">A material that maps the normal vectors to RGB colors.</div>
- <iframe src='scenes/material-browser.html#MeshNormalMaterial'></iframe>
+ <iframe id="scene" src="scenes/material-browser.html#MeshNormalMaterial"></iframe>
+ <script>
- <h2>Constructor</h2>
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]( [page:Object parameters] )</h3>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/materials/MeshPhongMaterial.html | @@ -14,10 +14,25 @@ <h1>[name]</h1>
<div class="desc">A material for shiny surfaces, evaluated per pixel.</div>
- <iframe src='scenes/material-browser.html#MeshPhongMaterial'></iframe>
+ <iframe id="scene" src="scenes/material-browser.html#MeshPhongMaterial"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]( [page:Object parameters] )</h3>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/materials/MeshStandardMaterial.html | @@ -14,10 +14,25 @@ <h1>[name]</h1>
<div class="desc">TODO</div>
- <iframe src='scenes/material-browser.html#MeshStandardMaterial'></iframe>
+ <iframe id="scene" src="scenes/material-browser.html#MeshStandardMaterial"></iframe>
- <h2>Constructor</h2>
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
+ <h2>Constructor</h2>
<h3>[name]( [page:Object parameters] )</h3>
<div> | true |
Other | mrdoob | three.js | 759f45bb0b5d27acaec1eb3f9b9135aeeb4d3639.json | Add iOS workaround to documentation pages (#9280)
* Add iOS workaround to BoxBufferGeometry
* Add iOS workaround to CircleBufferGeometry
* Add iOS workaround to CircleGeometry
* Add iOS workaround to ConeBufferGeometry
* Add iOS workaround to ConeGeometry
* Add iOS workaround to CylinderBufferGeometry
* Add iOS workaround to CylinderGeometry
* Add iOS workaround to DodecahedronGeometry
* Add iOS workaround to IcosahedronGeometry
* Add iOS workaround to LatheBufferGeometry
* Add iOS workaround to LatheGeometry
* Add iOS workaround to OctahedronGeometry
* Add iOS workaround to PlaneBufferGeometry
* Add iOS workaround to PlaneGeometry
* Add iOS workaround to RingBufferGeometry
* Add iOS workaround to RingGeometry
* Move header for consistency
* Add iOS workaround to SphereBufferGeometry
* Add iOS workaround to SphereGeometry
* Add iOS workaround to TetrahedronGeometry
* Add iOS workaround to TextGeometry
* Add iOS workaround to TorusBufferGeometry
* Add iOS workaround to TorusGeometry
* Add iOS workaround to TorusKnotBufferGeometry
* Add iOS workaround to TorusKnotGeometry
* Add iOS workaround to SkinnedMesh
* Add iOS workaround to MeshBasicMaterial
* Add iOS workaround to MeshDepthMaterial
* Add iOS workaround to MeshLambertMaterial
* Add iOS workaround to MeshNormalMaterial
* Add iOS workaround to MeshPhongMaterial
* Add iOS workaround to MeshStandardMaterial | docs/api/objects/SkinnedMesh.html | @@ -14,10 +14,26 @@ <h1>[name]</h1>
<div class="desc">A mesh that has a [page:Skeleton] with [page:Bone bones] that can then be used to animate the vertices of the geometry.</div>
+ <iframe id="scene" src="scenes/bones-browser.html"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
+
<h2>Example</h2>
- <iframe src='scenes/bones-browser.html'></iframe>
-
<code>
var geometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
@@ -49,21 +65,17 @@ <h2>Example</h2>
armSkeleton.bones[ 1 ].rotation.x = 0.2;
</code>
-
<h2>Constructor</h2>
-
<h3>[name]( [page:Geometry geometry], [page:Material material], [page:boolean useVertexTexture] )</h3>
<div>
geometry — An instance of [page:Geometry]. [page:Geometry.skinIndices] and [page:Geometry.skinWeights] should be set.<br />
material — An instance of [page:Material] (optional).<br />
useVertexTexture -- Defines whether a vertex texture can be used (optional).
</div>
-
<h2>Properties</h2>
-
<h3>[property:array bones]</h3>
<div>
This contains the array of bones for this mesh. These should be set in the constructor.
@@ -135,7 +147,6 @@ <h3>[method:SkinnedMesh clone]()</h3>
Returns a clone of this SkinnedMesh object and its descendants.
</div>
-
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | true |
Other | mrdoob | three.js | 1d7b7f74cfba5adb85770464b96b6d98daf9985f.json | clockwise full ellipse (#9291)
The point returned by getPoint was always reverse clockwise on a full
ellipse even when the ellipse is clock wise. | src/extras/curves/EllipseCurve.js | @@ -46,9 +46,17 @@ THREE.EllipseCurve.prototype.getPoint = function( t ) {
}
- if ( this.aClockwise === true && deltaAngle != twoPi && ! samePoints ) {
+ if ( this.aClockwise === true && ! samePoints ) {
- deltaAngle = deltaAngle - twoPi;
+ if ( deltaAngle === twoPi ) {
+
+ deltaAngle = - twoPi;
+
+ } else {
+
+ deltaAngle = deltaAngle - twoPi;
+
+ }
}
| false |
Other | mrdoob | three.js | b4bc76723f85ef523fc5c7418184c461003ef5ab.json | Update animation.py (#9272)
bones scaling support: remove hard coded values, add _scale & _handle_scale_channel functions + tested export and import | utils/exporters/blender/addons/io_three/exporter/api/animation.py | @@ -1,5 +1,6 @@
"""
Module for handling the parsing of skeletal animation data.
+updated on 2/07/2016: bones scaling support (@uthor verteAzur verteAzur@multivers3d.fr)
"""
import math
@@ -91,18 +92,22 @@ def _parse_rest_action(action, armature, options):
action, rotation_matrix)
rot = _normalize_quaternion(rot)
+ sca, schange = _scale(bone, computed_frame,
+ action, armature.matrix_world)
+
pos_x, pos_y, pos_z = pos.x, pos.z, -pos.y
rot_x, rot_y, rot_z, rot_w = rot.x, rot.z, -rot.y, rot.w
+ sca_x, sca_y, sca_z = sca.x, sca.z, sca.y
if frame == start_frame:
time = (frame * frame_step - start_frame) / fps
- # @TODO: missing scale values
+
keyframe = {
constants.TIME: time,
constants.POS: [pos_x, pos_y, pos_z],
constants.ROT: [rot_x, rot_y, rot_z, rot_w],
- constants.SCL: [1, 1, 1]
+ constants.SCL: [sca_x, sca_y, sca_z]
}
keys.append(keyframe)
@@ -116,22 +121,23 @@ def _parse_rest_action(action, armature, options):
constants.TIME: time,
constants.POS: [pos_x, pos_y, pos_z],
constants.ROT: [rot_x, rot_y, rot_z, rot_w],
- constants.SCL: [1, 1, 1]
+ constants.SCL: [sca_x, sca_y, sca_z]
}
keys.append(keyframe)
# MIDDLE-FRAME: needs only one of the attributes,
# can be an empty frame (optional frame)
- elif pchange is True or rchange is True:
+ elif pchange is True or rchange is True or schange is True:
time = (frame * frame_step - start_frame) / fps
if pchange is True and rchange is True:
keyframe = {
constants.TIME: time,
constants.POS: [pos_x, pos_y, pos_z],
- constants.ROT: [rot_x, rot_y, rot_z, rot_w]
+ constants.ROT: [rot_x, rot_y, rot_z, rot_w],
+ constants.SCL: [sca_x, sca_y, sca_z]
}
elif pchange is True:
keyframe = {
@@ -143,6 +149,11 @@ def _parse_rest_action(action, armature, options):
constants.TIME: time,
constants.ROT: [rot_x, rot_y, rot_z, rot_w]
}
+ elif schange is True:
+ keyframe = {
+ constants.TIME: time,
+ constants.SCL: [sca_x, sca_y, sca_z]
+ }
keys.append(keyframe)
@@ -495,6 +506,60 @@ def _rotation(bone, frame, action, armature_matrix):
return rotation, change
+def _scale(bone, frame, action, armature_matrix):
+ """
+
+ :param bone:
+ :param frame:
+ :param action:
+ :param armature_matrix:
+
+ """
+ scale = mathutils.Vector((0.0, 0.0, 0.0))
+
+ change = False
+
+ ngroups = len(action.groups)
+
+ # animation grouped by bones
+
+ if ngroups > 0:
+
+ index = -1
+
+ for i in range(ngroups):
+ if action.groups[i].name == bone.name:
+
+ print(action.groups[i].name)
+
+ index = i
+
+ if index > -1:
+ for channel in action.groups[index].channels:
+
+ if "scale" in channel.data_path:
+ has_changed = _handle_scale_channel(
+ channel, frame, scale)
+ change = change or has_changed
+
+ # animation in raw fcurves
+
+ else:
+
+ bone_label = '"%s"' % bone.name
+
+ for channel in action.fcurves:
+ data_path = channel.data_path
+ if bone_label in data_path and "scale" in data_path:
+ has_changed = _handle_scale_channel(
+ channel, frame, scale)
+ change = change or has_changed
+
+
+ #scale.xyz = armature_matrix * scale.xyz
+
+ return scale, change
+
def _handle_rotation_channel(channel, frame, rotation):
"""
@@ -559,6 +624,34 @@ def _handle_position_channel(channel, frame, position):
return change
+def _handle_scale_channel(channel, frame, scale):
+ """
+
+ :param channel:
+ :param frame:
+ :param position:
+
+ """
+ change = False
+
+ if channel.array_index in [0, 1, 2]:
+ for keyframe in channel.keyframe_points:
+ if keyframe.co[0] == frame:
+ change = True
+
+ value = channel.evaluate(frame)
+
+ if channel.array_index == 0:
+ scale.x = value
+
+ if channel.array_index == 1:
+ scale.y = value
+
+ if channel.array_index == 2:
+ scale.z = value
+
+ return change
+
def _quaternion_length(quat):
"""Calculate the length of a quaternion | false |
Other | mrdoob | three.js | febb7f8d6bf5b506e49116dd8aba6c915905cb5b.json | Add iOS workaround to BoxGeometry (#9196)
* Add iOS workaround to BoxGeometry
* Update iOS workaround
* Update iOS workaround
* Update iOS workaround
* Update iOS workaround | docs/api/extras/geometries/BoxGeometry.html | @@ -14,7 +14,23 @@ <h1>[name]</h1>
<div class="desc">BoxGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided with the 'width', 'height', and 'depth' constructor arguments.</div>
- <iframe src='scenes/geometry-browser.html#BoxGeometry'></iframe>
+ <iframe id="scene" src="scenes/geometry-browser.html#BoxGeometry"></iframe>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -26,7 +42,6 @@ <h2>Example</h2>
<h2>Constructor</h2>
-
<h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:Integer widthSegments], [page:Integer heightSegments], [page:Integer depthSegments])</h3>
<div>
width — Width of the sides on the X axis.<br />
@@ -37,7 +52,6 @@ <h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:In
depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1.
</div>
-
<h2>Properties</h2>
<h3>.parameters</h3> | false |
Other | mrdoob | three.js | 6cd9b057560254759961a292be24a8ed1f9c45e9.json | Fix spelling in Vector3 documentation (#9268) | docs/api/math/Vector3.html | @@ -394,15 +394,15 @@ <h3>[method:Vector3 reflect]( [page:Vector3 normal] ) [page:Vector3 this]</h3>
normal -- [page:Vector3] the normal to the reflecting plane
</div>
<div>
- Reflect incident vector off of plane orthogonal to normal. normal is assumed to have unit length.
+ Reflect incident vector off of plane orthogonal to normal. Normal is assumed to have unit length.
</div>
<h3>[method:Vector3 multiply]( [page:Vector3 v] ) [page:Vector3 this]</h3>
<div>
v -- [page:Vector3] <br />
</div>
<div>
- Multipies this vector by vector v.
+ Multiplies this vector by vector v.
</div>
<h3>[method:Vector3 applyProjection]( [page:Matrix4 m] ) [page:Vector3 this]</h3>
@@ -418,7 +418,7 @@ <h3>[method:Vector3 applyEuler]( [page:Euler euler] ) [page:Vector3 this]</h3>
euler -- [page:Euler]
</div>
<div>
- Applies euler transform to this vector by converting the [page:Euler] obect to a [page:Quaternion] and applying.
+ Applies euler transform to this vector by converting the [page:Euler] object to a [page:Quaternion] and applying.
</div>
<h3>[method:Vector3 applyQuaternion]( [page:Quaternion quaternion] ) [page:Vector3 this]</h3> | true |
Other | mrdoob | three.js | 6cd9b057560254759961a292be24a8ed1f9c45e9.json | Fix spelling in Vector3 documentation (#9268) | editor/js/libs/tern-threejs/threejs.js | @@ -4681,15 +4681,15 @@
},
"reflect": {
"!type": "fn(normal: +THREE.Vector3) -> +THREE.Vector3",
- "!doc": "Reflect incident vector off of plane orthogonal to normal. normal is assumed to have unit length."
+ "!doc": "Reflect incident vector off of plane orthogonal to normal. Normal is assumed to have unit length."
},
"fromArray": {
"!type": "fn(array: []) -> +THREE.Vector3",
"!doc": "Sets the vector's components based on an array formatted like [x, y, z]"
},
"multiply": {
"!type": "fn(v: +THREE.Vector3) -> +THREE.Vector3",
- "!doc": "Multipies this vector by vector v."
+ "!doc": "Multiplies this vector by vector v."
},
"applyProjection": {
"!type": "fn(m: +THREE.Matrix4) -> +THREE.Vector3",
@@ -4701,7 +4701,7 @@
},
"applyEuler": {
"!type": "fn(euler: +THREE.Euler) -> +THREE.Vector3",
- "!doc": "Applies euler transform to this vector by converting the [page:Euler] obect to a [page:Quaternion] and applying."
+ "!doc": "Applies euler transform to this vector by converting the [page:Euler] object to a [page:Quaternion] and applying."
},
"applyQuaternion": {
"!type": "fn(quaternion: +THREE.Quaternion) -> +THREE.Vector3", | true |
Other | mrdoob | three.js | d3606272b38bfedee5978e9caef7715fb8ef5743.json | adopt pow2, pow3, pow4 | src/renderers/shaders/ShaderChunk/bsdfs.glsl | @@ -58,9 +58,9 @@ float G_GGX_Smith( const in float alpha, const in float dotNL, const in float do
float a2 = alpha * alpha;
- float gl = dotNL + pow( a2 + ( 1.0 - a2 ) * dotNL * dotNL, 0.5 );
+ float gl = dotNL + pow( a2 + ( 1.0 - a2 ) * pow2( dotNL ), 0.5 );
- float gv = dotNV + pow( a2 + ( 1.0 - a2 ) * dotNV * dotNV, 0.5 );
+ float gv = dotNV + pow( a2 + ( 1.0 - a2 ) * pow2( dotNV ), 0.5 );
return 1.0 / ( gl * gv );
@@ -72,11 +72,11 @@ float G_GGX_Smith( const in float alpha, const in float dotNL, const in float do
// alpha is "roughness squared" in Disney’s reparameterization
float D_GGX( const in float alpha, const in float dotNH ) {
- float a2 = alpha * alpha;
+ float a2 = pow2( alpha );
- float denom = dotNH * dotNH * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1
+ float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1
- return RECIPROCAL_PI * a2 / ( denom * denom );
+ return RECIPROCAL_PI * a2 / pow2( denom );
}
@@ -158,7 +158,7 @@ vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in Ge
// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html
float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {
- return ( 2.0 / square( ggxRoughness + 0.0001 ) - 2.0 );
+ return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );
}
float BlinnExponentToGGXRoughness( const in float blinnExponent ) { | true |
Other | mrdoob | three.js | d3606272b38bfedee5978e9caef7715fb8ef5743.json | adopt pow2, pow3, pow4 | src/renderers/shaders/ShaderChunk/common.glsl | @@ -8,9 +8,9 @@
#define saturate(a) clamp( a, 0.0, 1.0 )
#define whiteCompliment(a) ( 1.0 - saturate( a ) )
-float square( const in float x ) { return x*x; }
-float cube( const in float x ) { return x*x*x; }
-float pow4( const in float x ) { return x*x*x*x; }
+float pow2( const in float x ) { return x*x; }
+float pow3( const in float x ) { return x*x*x; }
+float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
| true |
Other | mrdoob | three.js | d3606272b38bfedee5978e9caef7715fb8ef5743.json | adopt pow2, pow3, pow4 | src/renderers/shaders/ShaderChunk/lights_pars.glsl | @@ -210,10 +210,10 @@
float getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {
//float envMapWidth = pow( 2.0, maxMIPLevelScalar );
- //float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( square( blinnShininessExponent ) + 1.0 );
+ //float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );
float maxMIPLevelScalar = float( maxMIPLevel );
- float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( square( blinnShininessExponent ) + 1.0 );
+ float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );
// clamp to allowable LOD ranges.
return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); | true |
Other | mrdoob | three.js | 4c0b8571458a12f070debce5f1129910ec1cdaf9.json | fix cylinder normals | src/extras/geometries/CylinderBufferGeometry.js | @@ -135,6 +135,15 @@ THREE.CylinderBufferGeometry = function ( radiusTop, radiusBottom, height, radia
// normal
normal.copy( vertex );
+
+ // handle special case if radiusTop/radiusBottom is zero
+ if( ( radiusTop === 0 && y === 0 ) || ( radiusBottom === 0 && y === heightSegments ) ) {
+
+ normal.x = Math.sin( u * thetaLength + thetaStart );
+ normal.z = Math.cos( u * thetaLength + thetaStart );
+
+ }
+
normal.setY( Math.sqrt( normal.x * normal.x + normal.z * normal.z ) * tanTheta ).normalize();
normals.setXYZ( index, normal.x, normal.y, normal.z );
| false |
Other | mrdoob | three.js | 8ccfee363c4a8e736e804bd5406dd603285b73bc.json | remove unused code per @mrdoob. | src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl | @@ -1,5 +1,3 @@
-#define DISABLE_CUBE_UV_MIPMAP_INTERPOLATION
-
#ifdef ENVMAP_TYPE_CUBE_UV
const float cubeUV_textureSize = 1024.0;
@@ -112,10 +110,8 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {
float level1 = level0 + 1.0;
level1 = level1 > 5.0 ? 5.0 : level1;
-#if defined( DISABLE_CUBE_UV_MIPMAP_INTERPOLATION )
// round to nearest mipmap if we are not interpolating.
level0 += min( floor( s + 0.5 ), 5.0 );
-#endif
// Tri linear interpolation.
vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);
@@ -126,19 +122,6 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {
vec4 result = mix(color10, color20, t);
-#if ! defined( DISABLE_CUBE_UV_MIPMAP_INTERPOLATION )
-
- vec2 uv_11 = getCubeUV(reflectedDirection, r1, level1);
- vec4 color11 = envMapTexelToLinear(texture2D(envMap, uv_11));
-
- vec2 uv_21 = getCubeUV(reflectedDirection, r2, level1);
- vec4 color21 = envMapTexelToLinear(texture2D(envMap, uv_21));
-
- vec4 c2 = mix(color11, color21, t);
- result = mix(result, c2, s);
-
-#endif
-
return vec4(result.rgb, 1.0);
}
| false |
Other | mrdoob | three.js | 9d42f10fc75b0bad07fd01556ea45067349181c8.json | avoid new's in editor controls with Spherical. | examples/js/controls/EditorControls.js | @@ -26,6 +26,7 @@ THREE.EditorControls = function ( object, domElement ) {
var normalMatrix = new THREE.Matrix3();
var pointer = new THREE.Vector2();
var pointerOld = new THREE.Vector2();
+ var spherical = new THREE.Spherical();
// events
@@ -86,15 +87,15 @@ THREE.EditorControls = function ( object, domElement ) {
vector.copy( object.position ).sub( center );
- var spherical = new THREE.Spherical().fromVector3( vector );
+ spherical.fromVector3( vector );
spherical.theta += delta.x;
spherical.phi += delta.y;
spherical.makeSafe();
- vector = spherical.toVector3();
-
+ vector = spherical.toVector3( vector );
+
object.position.copy( center ).add( vector );
object.lookAt( center ); | false |
Other | mrdoob | three.js | a9867fe4ad5805c4a7ccb461d52022667705ea81.json | add radius to Spherical Coordinate class. | examples/js/controls/EditorControls.js | @@ -86,17 +86,15 @@ THREE.EditorControls = function ( object, domElement ) {
vector.copy( object.position ).sub( center );
- var spherical = new THREE.Spherical().fromDirection( vector );
+ var spherical = new THREE.Spherical().fromVector3( vector );
spherical.theta += delta.x;
spherical.phi += delta.y;
spherical.makeSafe();
- var radius = vector.length();
-
- vector = spherical.direction().multiplyScalar( radius );
-
+ vector = spherical.toVector3();
+
object.position.copy( center ).add( vector );
object.lookAt( center ); | true |
Other | mrdoob | three.js | a9867fe4ad5805c4a7ccb461d52022667705ea81.json | add radius to Spherical Coordinate class. | examples/js/controls/OrbitControls.js | @@ -133,7 +133,7 @@ THREE.OrbitControls = function ( object, domElement ) {
offset.applyQuaternion( quat );
// angle from z-axis around y-axis
- spherical.fromDirection( offset );
+ spherical.fromVector3( offset );
if ( scope.autoRotate && state === STATE.NONE ) {
@@ -149,18 +149,18 @@ THREE.OrbitControls = function ( object, domElement ) {
// restrict phi to be between desired limits
spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) );
- // restrict phi to be betwee EPS and PI-EPS
- spherical.phi = Math.max( EPS, Math.min( Math.PI - EPS, spherical.phi ) );
+ spherical.makeSafe();
- var radius = offset.length() * scale;
+
+ spherical.radius *= scale;
// restrict radius to be between desired limits
- radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, radius ) );
+ spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );
// move target to panned location
scope.target.add( panOffset );
- offset = spherical.direction( offset ).multiplyScalar( radius );
+ offset = spherical.toVector3( offset );
// rotate offset back to "camera-up-vector-is-up" space
offset.applyQuaternion( quatInverse );
@@ -175,7 +175,7 @@ THREE.OrbitControls = function ( object, domElement ) {
} else {
- sphericalDelta.set( 0, 0 );
+ sphericalDelta.set( 0, 0, 0 );
}
| true |
Other | mrdoob | three.js | a9867fe4ad5805c4a7ccb461d52022667705ea81.json | add radius to Spherical Coordinate class. | src/math/Spherical.js | @@ -1,10 +1,14 @@
/**
* @author bhouston / http://clara.io
* @author WestLangley / http://github.com/WestLangley
+ *
+ * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system
+ *
*/
-THREE.Spherical = function ( phi, theta ) {
+THREE.Spherical = function ( radius, phi, theta ) {
+ this.radius = ( radius !== undefined ) ? radius : 1.0;
this.phi = ( phi !== undefined ) ? phi : 0; // up / down towards top and bottom pole
this.theta = ( theta !== undefined ) ? theta : 0; // around the equator of the sphere
@@ -16,8 +20,9 @@ THREE.Spherical.prototype = {
constructor: THREE.Spherical,
- set: function ( phi, theta ) {
+ set: function ( radius, phi, theta ) {
+ this.radius = radius;
this.phi = phi;
this.theta = theta;
@@ -31,6 +36,7 @@ THREE.Spherical.prototype = {
copy: function ( other ) {
+ this.radius.copy( other.radius );
this.phi.copy( other.phi );
this.theta.copy( other.theta );
@@ -40,6 +46,7 @@ THREE.Spherical.prototype = {
add: function ( other ) {
+ this.radius += other.radius;
this.phi += other.phi;
this.theta += other.theta;
@@ -49,6 +56,7 @@ THREE.Spherical.prototype = {
multiplyScalar: function( scalar ) {
+ this.radius *= scalar;
this.phi *= scalar;
this.theta *= scalar;
@@ -63,23 +71,30 @@ THREE.Spherical.prototype = {
},
- fromDirection: function( direction ) {
+ fromVector3: function( vec3 ) {
- this.theta = Math.atan2( direction.x, direction.z ); // equator angle around y-up axis
- this.phi = Math.atan2( Math.sqrt( direction.x * direction.x + direction.z * direction.z ), direction.y ); // polar angle
+ this.radius = vec3.length();
+ if( this.radius === 0 ) {
+ this.theta = 0;
+ this.phi = 0;
+ }
+ else {
+ this.theta = Math.atan2( vec3.x, vec3.z ); // equator angle around y-up axis
+ this.phi = Math.acos( vec3.y / this.radius ); // polar angle
+ }
return this;
},
- direction: function( optionalTarget ) {
+ toVector3: function( optionalTarget ) {
var result = optionalTarget || new THREE.Vector3();
- var sinPhi = Math.sin( this.phi );
+ var sinPhiRadius = Math.sin( this.phi ) * this.radius;
result.set(
- sinPhi * Math.sin( this.theta ),
- Math.cos( this.phi ),
- sinPhi * Math.cos( this.theta )
+ sinPhiRadius * Math.sin( this.theta ),
+ Math.cos( this.phi ) * this.radius,
+ sinPhiRadius * Math.cos( this.theta )
);
return result; | true |
Other | mrdoob | three.js | 8c424ae663f618f1712a010b6b832903a28fc714.json | adopt Spherical in editor. | examples/js/controls/EditorControls.js | @@ -86,21 +86,16 @@ THREE.EditorControls = function ( object, domElement ) {
vector.copy( object.position ).sub( center );
- var theta = Math.atan2( vector.x, vector.z );
- var phi = Math.atan2( Math.sqrt( vector.x * vector.x + vector.z * vector.z ), vector.y );
+ var spherical = new THREE.Spherical().fromDirection( vector );
- theta += delta.x;
- phi += delta.y;
+ spherical.theta += delta.x;
+ spherical.phi += delta.y;
- var EPS = 0.000001;
-
- phi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );
+ spherical.makeSafe();
var radius = vector.length();
- vector.x = radius * Math.sin( phi ) * Math.sin( theta );
- vector.y = radius * Math.cos( phi );
- vector.z = radius * Math.sin( phi ) * Math.cos( theta );
+ vector = spherical.direction().multiplyScalar( radius );
object.position.copy( center ).add( vector );
| true |
Other | mrdoob | three.js | 8c424ae663f618f1712a010b6b832903a28fc714.json | adopt Spherical in editor. | src/math/Spherical.js | @@ -9,7 +9,7 @@ THREE.Spherical = function ( phi, theta ) {
this.theta = ( theta !== undefined ) ? theta : 0; // around the equator of the sphere
return this;
-
+
};
THREE.Spherical.prototype = {
@@ -55,6 +55,14 @@ THREE.Spherical.prototype = {
return this;
},
+ // restrict phi to be betwee EPS and PI-EPS
+ makeSafe: function() {
+
+ var EPS = 0.000001;
+ this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );
+
+ },
+
fromDirection: function( direction ) {
this.theta = Math.atan2( direction.x, direction.z ); // equator angle around y-up axis | true |
Other | mrdoob | three.js | ac6560bc29ef1b39582104364460ec393c51e74a.json | Replace three.min.js with non-minified version
Replace three.min.js with non-minified version in the "create your first scene" introduction.
Continuing from there beginners will have a hard time debugging their code using the minified version. | docs/manual/introduction/Creating-a-scene.html | @@ -19,7 +19,7 @@ <h2>What is Three.js?</h2>
<div>Three.js is a library that makes WebGL - 3D in the browser - easy to use. While a simple cube in raw WebGL would turn out hundreds of lines of Javascript and shader code, a Three.js equivalent is only a fraction of that.</div>
<h2>Before we start</h2>
- <div>Before you can use Three.js, you need somewhere to display it. Save the following HTML to a file on your computer, along with a copy of <a href="http://threejs.org/build/three.min.js">three.min.js</a> in the js/ directory, and open it in your browser.</div>
+ <div>Before you can use Three.js, you need somewhere to display it. Save the following HTML to a file on your computer, along with a copy of <a href="http://threejs.org/build/three.js">three.js</a> in the js/ directory, and open it in your browser.</div>
<code>
<!DOCTYPE html>
@@ -33,7 +33,7 @@ <h2>Before we start</h2>
</style>
</head>
<body>
- <script src="js/three.min.js"></script>
+ <script src="js/three.js"></script>
<script>
// Our Javascript will go here.
</script>
@@ -132,7 +132,7 @@ <h2>The result</h2>
</style>
</head>
<body>
- <script src="js/three.min.js"></script>
+ <script src="js/three.js"></script>
<script>
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); | false |
Other | mrdoob | three.js | 772a89cb372a841dea6187eaca6a51fa5da2587d.json | fix utf8 decoder without native TextDecoder | examples/js/loaders/sea3d/SEA3D.js | @@ -9,7 +9,7 @@ var SEA3D = { VERSION: 18100 };
SEA3D.getVersion = function () {
- // Max = 16777215 - VVSSBB | V = Version | S = Subversion | B = Buildversion
+ // Max = 16777215 - VV.S.S.BB | V = Version | S = Subversion | B = Buildversion
var v = SEA3D.VERSION.toString(), l = v.length;
return v.substring( 0, l - 4 ) + "." + v.substring( l - 4, l - 3 ) + "." + v.substring( l - 3, l - 2 ) + "." + parseFloat( v.substring( l - 2, l ) ).toString();
@@ -99,6 +99,7 @@ SEA3D.Stream.sizeOf = function ( kind ) {
};
SEA3D.Stream.prototype = {
+
constructor: SEA3D.Stream,
set buffer( val ) {
@@ -278,7 +279,15 @@ SEA3D.Stream.prototype.readUTF8 = function ( len ) {
var buffer = this.readBytes( len );
- return window.TextDecoder ? new TextDecoder().decode( buffer ) : String.fromCharCode.apply( undefined, new Uint16Array( new Uint8Array( buffer ) ) );
+ if ( window.TextDecoder ) {
+
+ return new TextDecoder().decode( buffer );
+
+ } else {
+
+ return decodeURIComponent( escape( String.fromCharCode.apply( null, new Uint8Array( buffer ) ) ) );
+
+ }
};
| false |
Other | mrdoob | three.js | b7ddb8a3104dbd317a49fa43d2fd9e2f5797baaa.json | Fix a function name in WebGLDeferredRenderer | examples/js/renderers/WebGLDeferredRenderer.js | @@ -663,7 +663,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
return getMaterialFromCacheOrCreate(
originalMaterial,
_invisibleMultiMaterialsCache,
- createInvisibleMultiMaterial
+ createInvisibleMaterial
);
} | false |
Other | mrdoob | three.js | 8ed3615868c79154cb9f21474321b65750b3f7b2.json | add support for cineon tone mapping. | examples/webgl_tonemapping.html | @@ -72,7 +72,8 @@
None: THREE.NoToneMapping,
Linear: THREE.LinearToneMapping,
Reinhard: THREE.ReinhardToneMapping,
- Uncharted2: THREE.Uncharted2ToneMapping
+ Uncharted2: THREE.Uncharted2ToneMapping,
+ Cineon: THREE.CineonToneMapping
};
var camera, scene, renderer, controls, objects = []; | true |
Other | mrdoob | three.js | 8ed3615868c79154cb9f21474321b65750b3f7b2.json | add support for cineon tone mapping. | src/Three.js | @@ -214,7 +214,8 @@ THREE.AddOperation = 2;
THREE.NoToneMapping = 0; // do not do any tone mapping, not even exposure (required for special purpose passes.)
THREE.LinearToneMapping = 1; // only apply exposure.
THREE.ReinhardToneMapping = 2;
-THREE.Uncharted2ToneMapping = 3;
+THREE.Uncharted2ToneMapping = 3; // John Hable
+THREE.CineonToneMapping = 4; // optimized filmic operator by Jim Hejl and Richard Burgess-Dawson
// Mapping modes
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.