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 | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_materials_video.html | @@ -29,15 +29,13 @@
<script>
- var AMOUNT = 100;
-
var container, stats;
var camera, scene, renderer;
var video, image, imageContext,
- imageReflection, imageReflectionContext, imageReflectionGradient,
- texture, textureReflection;
+ imageReflection, imageReflectionContext, imageReflectionGradient,
+ texture, textureReflection;
var mesh;
@@ -107,10 +105,10 @@
mesh = new THREE.Mesh( plane, material );
mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
- scene.add(mesh);
+ scene.add( mesh );
mesh = new THREE.Mesh( plane, materialReflection );
- mesh.position.y = -306;
+ mesh.position.y = - 306;
mesh.rotation.x = - Math.PI;
mesh.scale.x = mesh.scale.y = mesh.scale.z = 1.5;
scene.add( mesh );
@@ -135,13 +133,13 @@
} );
- for ( var ix = 0; ix < amountx; ix++ ) {
+ for ( var ix = 0; ix < amountx; ix ++ ) {
- for ( var iy = 0; iy < amounty; iy++ ) {
+ for ( var iy = 0; iy < amounty; iy ++ ) {
var sprite = new THREE.Sprite( material );
sprite.position.x = ix * separation - ( ( amountx * separation ) / 2 );
- sprite.position.y = -153;
+ sprite.position.y = - 153;
sprite.position.z = iy * separation - ( ( amounty * separation ) / 2 );
sprite.scale.setScalar( 2 );
scene.add( sprite ); | true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_morphtargets_horse.html | @@ -27,8 +27,7 @@
<script>
var container, stats;
- var camera, scene, projector, renderer;
- var mesh, mixer;
+ var camera, scene, renderer, mixer;
init();
animate();
@@ -62,7 +61,7 @@
scene.add( light );
var light = new THREE.DirectionalLight( 0xffefef, 1.5 );
- light.position.set( -1, -1, -1 ).normalize();
+ light.position.set( - 1, - 1, - 1 ).normalize();
scene.add( light );
var loader = new THREE.GLTFLoader();
@@ -86,7 +85,7 @@
renderer = new THREE.CanvasRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
- container.appendChild(renderer.domElement);
+ container.appendChild( renderer.domElement );
//
| true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_particles_floor.html | @@ -53,9 +53,9 @@
var material = new THREE.SpriteMaterial();
- for ( var ix = 0; ix < AMOUNTX; ix++ ) {
+ for ( var ix = 0; ix < AMOUNTX; ix ++ ) {
- for ( var iy = 0; iy < AMOUNTY; iy++ ) {
+ for ( var iy = 0; iy < AMOUNTY; iy ++ ) {
particle = new THREE.Sprite( material );
particle.scale.y = 20;
@@ -79,8 +79,6 @@
document.addEventListener( 'touchstart', onDocumentTouchStart, false );
document.addEventListener( 'touchmove', onDocumentTouchMove, false );
- //
-
window.addEventListener( 'resize', onWindowResize, false );
}
@@ -97,12 +95,11 @@
}
- //
-
function onDocumentMouseMove( event ) {
mouseX = event.clientX - windowHalfX;
mouseY = event.clientY - windowHalfY;
+
}
function onDocumentTouchStart( event ) {
@@ -113,7 +110,9 @@
mouseX = event.touches[ 0 ].pageX - windowHalfX;
mouseY = event.touches[ 0 ].pageY - windowHalfY;
+
}
+
}
function onDocumentTouchMove( event ) {
@@ -124,12 +123,11 @@
mouseX = event.touches[ 0 ].pageX - windowHalfX;
mouseY = event.touches[ 0 ].pageY - windowHalfY;
+
}
}
- //
-
function animate() {
requestAnimationFrame( animate ); | true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_particles_random.html | @@ -59,7 +59,7 @@
group = new THREE.Group();
scene.add( group );
- for ( var i = 0; i < 1000; i++ ) {
+ for ( var i = 0; i < 1000; i ++ ) {
var material = new THREE.SpriteCanvasMaterial( {
color: Math.random() * 0x808008 + 0x808080,
@@ -72,6 +72,7 @@
particle.position.z = Math.random() * 2000 - 1000;
particle.scale.x = particle.scale.y = Math.random() * 20 + 10;
group.add( particle );
+
}
renderer = new THREE.CanvasRenderer();
@@ -110,6 +111,7 @@
mouseX = event.clientX - windowHalfX;
mouseY = event.clientY - windowHalfY;
+
}
function onDocumentTouchStart( event ) { | true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_particles_sprites.html | @@ -54,13 +54,14 @@
blending: THREE.AdditiveBlending
} );
- for ( var i = 0; i < 1000; i++ ) {
+ for ( var i = 0; i < 1000; i ++ ) {
particle = new THREE.Sprite( material );
initParticle( particle, i * 10 );
scene.add( particle );
+
}
renderer = new THREE.CanvasRenderer();
@@ -145,6 +146,7 @@
mouseX = event.clientX - windowHalfX;
mouseY = event.clientY - windowHalfY;
+
}
function onDocumentTouchStart( event ) { | true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_particles_waves.html | @@ -170,7 +170,7 @@
for ( var iy = 0; iy < AMOUNTY; iy ++ ) {
- particle = particles[ i++ ];
+ particle = particles[ i ++ ];
particle.position.y = ( Math.sin( ( ix + count ) * 0.3 ) * 50 ) +
( Math.sin( ( iy + count ) * 0.5 ) * 50 );
particle.scale.x = particle.scale.y = ( Math.sin( ( ix + count ) * 0.3 ) + 1 ) * 4 + | true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_performance.html | @@ -85,7 +85,7 @@
container.appendChild( renderer.domElement );
stats = new Stats();
- container.appendChild(stats.dom);
+ container.appendChild( stats.dom );
//
| true |
Other | mrdoob | three.js | e79b63e9db28426b9ebadb7342cd22034ace06ee.json | fix linter errors in canvas examples | examples/canvas_sandbox.html | @@ -27,8 +27,7 @@
var container, stats;
- var camera, scene, renderer;
- var controls, group;
+ var camera, scene, renderer, group;
init();
animate();
@@ -87,7 +86,7 @@
container.appendChild( renderer.domElement );
stats = new Stats();
- container.appendChild(stats.dom);
+ container.appendChild( stats.dom );
//
@@ -117,7 +116,7 @@
function render() {
- for ( var i = 0, l = group.children.length; i < l; i++ ) {
+ for ( var i = 0, l = group.children.length; i < l; i ++ ) {
var object = group.children[ i ];
| true |
Other | mrdoob | three.js | b59cdc0f95bb5244d278a48264d299058f73e3ae.json | Rename Texture3D to DataTexture3D | examples/webgl_materials_texture3d.html | @@ -119,7 +119,7 @@
var zip = new JSZip( data );
var array = zip.files[ 'head256x256x109' ].asUint8Array();
- var texture = new THREE.Texture3D( array, 256, 256, 109 );
+ var texture = new THREE.DataTexture3D( array, 256, 256, 109 );
texture.format = THREE.RedFormat;
texture.type = THREE.UnsignedByteType; | true |
Other | mrdoob | three.js | b59cdc0f95bb5244d278a48264d299058f73e3ae.json | Rename Texture3D to DataTexture3D | examples/webgl_materials_texture3d_volume.html | @@ -121,7 +121,7 @@
// THREEJS will select R32F (33326) based on the RedFormat and FloatType.
// Also see https://www.khronos.org/registry/webgl/specs/latest/2.0/#TEXTURE_TYPES_FORMATS_FROM_DOM_ELEMENTS_TABLE
// TODO: look the dtype up in the volume metadata
- var texture = new THREE.Texture3D( volume.data, volume.xLength, volume.yLength, volume.zLength );
+ var texture = new THREE.DataTexture3D( volume.data, volume.xLength, volume.yLength, volume.zLength );
texture.format = THREE.RedFormat;
texture.type = THREE.FloatType;
texture.minFilter = texture.magFilter = THREE.LinearFilter; | true |
Other | mrdoob | three.js | b59cdc0f95bb5244d278a48264d299058f73e3ae.json | Rename Texture3D to DataTexture3D | src/Three.js | @@ -24,7 +24,7 @@ export { Points } from './objects/Points.js';
export { Group } from './objects/Group.js';
export { VideoTexture } from './textures/VideoTexture.js';
export { DataTexture } from './textures/DataTexture.js';
-export { Texture3D } from './textures/Texture3D.js';
+export { DataTexture3D } from './textures/DataTexture3D.js';
export { CompressedTexture } from './textures/CompressedTexture.js';
export { CubeTexture } from './textures/CubeTexture.js';
export { CanvasTexture } from './textures/CanvasTexture.js'; | true |
Other | mrdoob | three.js | b59cdc0f95bb5244d278a48264d299058f73e3ae.json | Rename Texture3D to DataTexture3D | src/renderers/webgl/WebGLTextures.js | @@ -489,7 +489,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var textureType;
- if ( texture.isTexture3D ) {
+ if ( texture.isDataTexture3D ) {
textureType = _gl.TEXTURE_3D;
@@ -648,7 +648,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
textureProperties.__maxMipLevel = mipmaps.length - 1;
- } else if ( texture.isTexture3D ) {
+ } else if ( texture.isDataTexture3D ) {
state.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );
textureProperties.__maxMipLevel = 0; | true |
Other | mrdoob | three.js | b59cdc0f95bb5244d278a48264d299058f73e3ae.json | Rename Texture3D to DataTexture3D | src/renderers/webgl/WebGLUniforms.js | @@ -51,10 +51,10 @@
import { CubeTexture } from '../../textures/CubeTexture.js';
import { Texture } from '../../textures/Texture.js';
-import { Texture3D } from '../../textures/Texture3D.js';
+import { DataTexture3D } from '../../textures/DataTexture3D.js';
var emptyTexture = new Texture();
-var emptyTexture3d = new Texture3D();
+var emptyTexture3d = new DataTexture3D();
var emptyCubeTexture = new CubeTexture();
// --- Base for inner nodes (including the root) --- | true |
Other | mrdoob | three.js | b59cdc0f95bb5244d278a48264d299058f73e3ae.json | Rename Texture3D to DataTexture3D | src/textures/DataTexture3D.js | @@ -5,12 +5,12 @@
import { Texture } from './Texture.js';
import { NearestFilter } from '../constants.js';
-function Texture3D( data, width, height, depth ) {
+function DataTexture3D( data, width, height, depth ) {
// We're going to add .setXXX() methods for setting properties later.
- // Users can still set in Texture3D directly.
+ // Users can still set in DataTexture3D directly.
//
- // var texture = new THREE.Texture3D( data, width, height, depth );
+ // var texture = new THREE.DataTexture3D( data, width, height, depth );
// texture.anisotropy = 16;
//
// See #14839
@@ -27,8 +27,8 @@ function Texture3D( data, width, height, depth ) {
}
-Texture3D.prototype = Object.create( Texture.prototype );
-Texture3D.prototype.constructor = Texture3D;
-Texture3D.prototype.isTexture3D = true;
+DataTexture3D.prototype = Object.create( Texture.prototype );
+DataTexture3D.prototype.constructor = DataTexture3D;
+DataTexture3D.prototype.isDataTexture3D = true;
-export { Texture3D };
+export { DataTexture3D }; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/api/en/animation/AnimationClip.html | @@ -96,10 +96,7 @@ <h3>[method:Array CreateClipsFromMorphTargetSequences]( [param:String name], [pa
<p>
Returns an array of new AnimationClips created from the [page:Geometry.morphTargets morph
target sequences] of a geometry, trying to sort morph target names into animation-group-based
- patterns like "Walk_001, Walk_002, Run_001, Run_002 ..."<br /><br />
-
- This method is called by the [page:JSONLoader] internally, and it uses
- [page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence].
+ patterns like "Walk_001, Walk_002, Run_001, Run_002 ...".
</p>
<h3>[method:AnimationClip CreateFromMorphTargetSequence]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/api/en/loaders/JSONLoader.html | @@ -1,122 +0,0 @@
-<!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>
- <h1>[name]</h1>
-
- <p class="desc">
- A loader for loading objects in JSON format.
- This uses the [page:FileLoader] internally for loading files.
- </p>
-
- <h2>Example</h2>
-
- <p>
- [example:webgl_loader_json WebGL / loader / json]
- </p>
-
- <code>
- // instantiate a loader
- var loader = new THREE.JSONLoader();
-
- // load a resource
- loader.load(
- // resource URL
- 'models/animated/monster/monster.js',
-
- // onLoad callback
- function ( geometry, materials ) {
- var material = materials[ 0 ];
- var object = new THREE.Mesh( geometry, material );
- scene.add( object );
- },
-
- // onProgress callback
- function ( xhr ) {
- console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
- },
-
- // onError callback
- function( err ) {
- console.log( 'An error happened' );
- }
- );
- </code>
-
- <h2>Constructor</h2>
-
- <h3>[name]( [param:LoadingManager manager] )</h3>
- <p>
- [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
- </p>
- <p>
- Creates a new [name].
- </p>
-
- <h2>Properties</h2>
-
- <h3>[property:String crossOrigin]</h3>
- <p>
- If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
- attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"anonymous"*.
- </p>
-
- <h3>[property:LoadingManager manager]</h3>
- <p>
- The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
- </p>
-
- <h3>[property:String withCredentials]</h3>
- <p>
- Whether the XMLHttpRequest uses credentials.
- Default is *false*.
- </p>
-
- <h2>Methods</h2>
-
- <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
- <p>
- [page:String url] — the path or URL to the file. This can also be a
- [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br />
- [page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
- [page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
- [page:Function onError] — Will be called when load errors.<br />
- </p>
- <p>
- Begin loading from url and pass the <em>JSON</em> to onLoad.
- </p>
-
- <h3>[method:Object3D parse]( [param:Object json], [param:String path] )</h3>
- <p>
- [page:String json] — JSON object to parse.<br />
- [page:String path] — Base path for resources if no resource path is defined.<br /><br />
-
- Parse a <em>JSON</em> structure and return an [page:object] containing the parsed [page:Geometry geometry] and [page:Array materials].
- </p>
-
- <h3>[method:JSONLoader setCrossOrigin]( [param:String value] )</h3>
- <p>
- Set the [page:.crossOrigin] attribute.
- </p>
-
- <h3>[method:JSONLoader setPath]( [param:String value] )</h3>
- <p>
- Set the base path for the original file.
- </p>
-
- <h3>[method:JSONLoader setResourcePath]( [param:String value] )</h3>
- <p>
- Set the base path for dependent resources like textures.
- </p>
-
- <h2>Source</h2>
-
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
-</html> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/api/en/loaders/ObjectLoader.html | @@ -13,8 +13,6 @@ <h1>[name]</h1>
<p class="desc">
A loader for loading a JSON resource in the [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].<br /><br />
- Note that this loader can't load geometries of type [page:Geometry]. Use [page:JSONLoader] instead for that.<br /><br />
-
This uses the [page:FileLoader] internally for loading files.
</p>
@@ -119,7 +117,6 @@ <h3>[method:Object3D parseGeometries]( [param:Object json] )</h3>
[page:Object json] — required. The JSON source to parse.<br /><br />
This is used [page:.parse] to parse any [page:Geometry geometries] or [page:BufferGeometry buffer geometries] in the JSON structure.
- Internally it uses [page:JSONLoader] for geometries and [page:BufferGeometryLoader] for buffer geometries.
</p>
<h3>[method:Object3D parseMaterials]( [param:Object json] )</h3> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/api/zh/animation/AnimationClip.html | @@ -91,10 +91,7 @@ <h2>静态方法</h2>
<h3>[method:Array CreateClipsFromMorphTargetSequences]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3>
<p>
返回从几何体的变形目标序列([page:Geometry.morphTargets morph
- target sequences])创建的新动画剪辑(AnimationClip)数组,并尝试将变形目标名称分类为基于动画组的模式,如“Walk_001、Walk_002、Run_001、Run_002……”。<br /><br />
-
- 该方法被[page:JSONLoader]内部调用, 并且它使用了
- [page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence].
+ target sequences])创建的新动画剪辑(AnimationClip)数组,并尝试将变形目标名称分类为基于动画组的模式,如“Walk_001、Walk_002、Run_001、Run_002……”。
</p>
<h3>[method:AnimationClip CreateFromMorphTargetSequence]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/api/zh/loaders/JSONLoader.html | @@ -1,119 +0,0 @@
-<!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>
- <h1>[name]</h1>
-
- <p class="desc">
- 以JSON格式来加载对象的加载器。
- 此加载器内部用 [page:FileLoader] 来加载文件。
- </p>
-
- <h2>例子</h2>
-
- <p>
- [example:webgl_loader_json WebGL / loader / json]<br />
- [example:webgl_loader_json_objconverter WebGL / loader / json / objconverter]
- </p>
-
- <code>
- // 初始化一个加载器
- var loader = new THREE.JSONLoader();
-
- // 加载一个资源
- loader.load(
- // 资源URL
- 'models/animated/monster/monster.js',
-
- // onLoad的回调
- function ( geometry, materials ) {
- var material = materials[ 0 ];
- var object = new THREE.Mesh( geometry, material );
- scene.add( object );
- },
-
- // onProgress的回调
- function ( xhr ) {
- console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
- },
-
- // onError的回调
- function( err ) {
- console.log( 'An error happened' );
- }
- );
- </code>
-
- <h2>构造函数</h2>
-
- <h3>[name]( [param:LoadingManager manager] )</h3>
- <p>
- [page:LoadingManager manager] — 加载器所使用的 [page:LoadingManager loadingManager]。 默认为 [page:LoadingManager THREE.DefaultLoadingManager].
- </p>
- <p>
- 创建一个新的 [name].
- </p>
-
- <h2>属性</h2>
-
- <h3>[property:String crossOrigin]</h3>
- <p>
- 如果设置了,在开始加载前, 将为图片分配 [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
- 属性,其值为 *crossOrigin*,默认为"anonymous"。
- </p>
-
- <h3>[property:LoadingManager manager]</h3>
- <p>
- 加载器正在使用的 [page:LoadingManager loadingManager] 。 默认为 [page:DefaultLoadingManager].
- </p>
-
- <h3>[property:String withCredentials]</h3>
- <p>
- XMLHttpRequest请求是否使用了证书。
- 默认为 *false*.
- </p>
-
- <h2>方法</h2>
-
- <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
- <p>
- [page:String url] — 文件的URL或者路径,也可以为
- [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br />
- [page:Function onLoad] — 加载完成时将调用。回调参数将是加载的响应。<br />
- [page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,
- 其中包含 [page:Integer total] 和 [page:Integer loaded] 字节。<br />
- [page:Function onError] — 在加载错误时被调用。<br />
- </p>
- <p>
- 从URL中进行加载并将 <em>JSON</em> 传递给 onLoad。
- </p>
-
- <h3>[method:JSONLoader setCrossOrigin]( [param:String value] )</h3>
- <p>
- 设置 [page:.crossOrigin] 的属性。
- </p>
-
- <h3>[method:JSONLoader setTexturePath]( [param:String texturePath] )</h3>
- <p>
- 设置加载文件的基本路径或URL。当加载同一目录中的许多模型,此方法将很有用。
- </p>
-
- <h3>[method:Object3D parse]( [param:Object json], [param:String texturePath] )</h3>
- <p>
- [page:String json] — 需要解析的JSON对象。<br />
- [page:String texturePath] — 纹理的基本路径。<br /><br />
-
- 解析要给 <em>JSON</em> 结构并返回 [page:object] 包含 [page:Geometry geometry] 和 [page:Array materials] 的对象.
- </p>
-
- <h2>源</h2>
-
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
-</html> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/api/zh/loaders/ObjectLoader.html | @@ -13,8 +13,6 @@ <h1>[name]</h1>
<p class="desc">
A loader for loading a JSON resource in the [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].<br /><br />
- Note that this loader can't load geometries of type [page:Geometry]. Use [page:JSONLoader] instead for that.<br /><br />
-
此加载器内部使用[page:FileLoader]进行加载文件。
</p>
@@ -118,7 +116,6 @@ <h3>[method:Object3D parseGeometries]( [param:Object json] )</h3>
[page:Object json] — 必选参数,需要被解析的JSON源。<br /><br />
此函数以JSON结构,用[page:.parse]去解析[page:Geometry geometries]或[page:BufferGeometry buffer geometries]。
- 在内部,它使用JSONLoader作为几何加载器,使用BufferGeometryLoader作为几何缓冲区加载器。
</p>
<h3>[method:Object3D parseMaterials]( [param:Object json] )</h3> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/list.js | @@ -233,7 +233,6 @@ var list = {
"FontLoader": "api/en/loaders/FontLoader",
"ImageBitmapLoader": "api/en/loaders/ImageBitmapLoader",
"ImageLoader": "api/en/loaders/ImageLoader",
- "JSONLoader": "api/en/loaders/JSONLoader",
"Loader": "api/en/loaders/Loader",
"LoaderUtils": "api/en/loaders/LoaderUtils",
"MaterialLoader": "api/en/loaders/MaterialLoader",
@@ -658,7 +657,6 @@ var list = {
"FontLoader": "api/zh/loaders/FontLoader",
"ImageBitmapLoader": "api/zh/loaders/ImageBitmapLoader",
"ImageLoader": "api/zh/loaders/ImageLoader",
- "JSONLoader": "api/zh/loaders/JSONLoader",
"Loader": "api/zh/loaders/Loader",
"LoaderUtils": "api/zh/loaders/LoaderUtils",
"MaterialLoader": "api/zh/loaders/MaterialLoader", | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/manual/en/introduction/Animation-system.html | @@ -107,7 +107,6 @@ <h3>Supported Formats and Loaders</h3>
</p>
<ul>
- <li>[page:JSONLoader THREE.JSONLoader]</li>
<li>[page:ObjectLoader THREE.ObjectLoader]</li>
<li>THREE.BVHLoader</li>
<li>THREE.ColladaLoader</li> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/manual/en/introduction/Loading-3D-models.html | @@ -79,7 +79,7 @@ <h2>Recommended workflow</h2>
<h2>Loading</h2>
<p>
- Only a few loaders ([page:ObjectLoader] and [page:JSONLoader]) are included by default with
+ Only a few loaders (e.g. [page:ObjectLoader]) are included by default with
three.js — others should be added to your page individually. Depending on your
preference and comfort with build tools, choose one of the following:
</p> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | docs/manual/zh/introduction/Animation-system.html | @@ -32,7 +32,7 @@ <h3>Animation Clips(动画片段)</h3>
<br /><br />
每个* AnimationClip *通常保存对象的某个活动的数据。 如果
mesh是一个字符,例如,可以有一个用于walkcycle的动画片段,第二个
- 跳跃,三分之一的回避等等。
+ 跳跃,三分之一的回避等等。
</p>
<h3>Keyframe Tracks(关键帧轨道)</h3>
@@ -83,11 +83,10 @@ <h3>Supported Formats and Loaders(支持的格式和加载器)</h3>
<p class="desc">
请注意,并非所有模型格式都包含动画(尤其是OBJ,没有),而且只有一些
three.js加载器支持[page:AnimationClip AnimationClip]序列。 以下几个<i>确实</ i>
- 支持此动画类型:
+ 支持此动画类型:
</p>
<ul>
- <li>[page:JSONLoader THREE.JSONLoader]</li>
<li>[page:ObjectLoader THREE.ObjectLoader]</li>
<li>THREE.BVHLoader</li>
<li>THREE.ColladaLoader</li> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | editor/js/Loader.js | @@ -576,50 +576,7 @@ var Loader = function ( editor ) {
case 'geometry':
- var loader = new THREE.JSONLoader();
- loader.setResourcePath( scope.texturePath );
-
- var result = loader.parse( data );
-
- var geometry = result.geometry;
- var material;
-
- if ( result.materials !== undefined ) {
-
- if ( result.materials.length > 1 ) {
-
- material = new THREE.MultiMaterial( result.materials );
-
- } else {
-
- material = result.materials[ 0 ];
-
- }
-
- } else {
-
- material = new THREE.MeshStandardMaterial();
-
- }
-
- geometry.sourceType = "ascii";
- geometry.sourceFile = file.name;
-
- var mesh;
-
- if ( geometry.animation && geometry.animation.hierarchy ) {
-
- mesh = new THREE.SkinnedMesh( geometry, material );
-
- } else {
-
- mesh = new THREE.Mesh( geometry, material );
-
- }
-
- mesh.name = filename;
-
- editor.execute( new AddObjectCommand( mesh ) );
+ console.error( 'Loader: "Geometry" is no longer supported.' );
break;
| true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | editor/js/libs/tern-threejs/threejs.js | @@ -1714,54 +1714,6 @@
"!doc": "A loader for loading an [page:Image].",
"!type": "fn(manager: +THREE.LoadingManager)"
},
- "JSONLoader": {
- "!url": "http://threejs.org/docs/#Reference/loaders/JSONLoader",
- "prototype": {
- "!proto": "THREE.Loader.prototype",
- "withCredentials": {
- "!type": "boolean",
- "!doc": "If true, the ajax request will use cookies."
- },
- "onLoadStart": {
- "!type": "function",
- "!doc": "The default is a function with empty body."
- },
- "onLoadComplete": {
- "!type": "function",
- "!doc": "The default is a function with empty body."
- },
- "load": {
- "!type": "fn(url: string, callback: function, texturePath: string)",
- "!doc": "[page:String url] — required<br>\n\t\t[page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br>\n\t\t[page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file."
- },
- "loadAjaxJSON": {
- "!type": "fn(context: +THREE.JSONLoader, url: string, callback: function, texturePath: string, callbackProgress: function)",
- "!doc": "Begin loading from url and call <em>callback</em> with the parsed response content."
- },
- "parse": {
- "!type": "fn(json: object, texturePath: string) -> +THREE.Object3D",
- "!doc": "Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials]."
- },
- "updateProgress": {
- "!type": "fn(progress: object)",
- "!doc": "Updates the DOM object with the progress made."
- },
- "createMaterial": {
- "!type": "fn(m: object, texturePath: string) -> +THREE.Material",
- "!doc": "Creates the Material based on the parameters m."
- },
- "initMaterials": {
- "!type": "fn(materials: [], texturePath: string) -> []",
- "!doc": "Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials."
- },
- "extractUrlBase": {
- "!type": "fn(url: string) -> string",
- "!doc": "Extract the base from the URL."
- }
- },
- "!doc": "A loader for loading objects in JSON format.",
- "!type": "fn()"
- },
"Loader": {
"!url": "http://threejs.org/docs/#Reference/loaders/Loader",
"prototype": {
@@ -1904,7 +1856,7 @@
"!doc": "[page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS."
}
},
- "!doc": "A loader for loading a JSON resource. Unlike the [page:JSONLoader], this one make use of the <em>.type</em> attributes of objects to map them to their original classes.",
+ "!doc": "A loader for loading a JSON resource.",
"!type": "fn(manager: +THREE.LoadingManager)"
},
"PDBLoader": { | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | examples/files.js | @@ -90,7 +90,6 @@ var files = {
"webgl_loader_gltf",
"webgl_loader_gltf_extensions",
"webgl_loader_imagebitmap",
- "webgl_loader_json",
"webgl_loader_json_claraio",
"webgl_loader_kmz",
"webgl_loader_md2", | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | examples/js/loaders/deprecated/JSONLoader.js | @@ -0,0 +1,578 @@
+/**
+ * @author mrdoob / http://mrdoob.com/
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+THREE.JSONLoader = ( function () {
+
+ function JSONLoader( manager ) {
+
+ if ( typeof manager === 'boolean' ) {
+
+ console.warn( 'THREE.JSONLoader: showStatus parameter has been removed from constructor.' );
+ manager = undefined;
+
+ }
+
+ this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
+
+ this.withCredentials = false;
+
+ }
+
+ Object.assign( JSONLoader.prototype, {
+
+ crossOrigin: 'anonymous',
+
+ load: function ( url, onLoad, onProgress, onError ) {
+
+ var scope = this;
+
+ var path = ( this.path === undefined ) ? THREE.LoaderUtils.extractUrlBase( url ) : this.path;
+
+ var loader = new THREE.FileLoader( this.manager );
+ loader.setPath( this.path );
+ loader.setWithCredentials( this.withCredentials );
+ loader.load( url, function ( text ) {
+
+ var json = JSON.parse( text );
+ var metadata = json.metadata;
+
+ if ( metadata !== undefined ) {
+
+ var type = metadata.type;
+
+ if ( type !== undefined ) {
+
+ if ( type.toLowerCase() === 'object' ) {
+
+ console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' );
+ return;
+
+ }
+
+ }
+
+ }
+
+ var object = scope.parse( json, path );
+ onLoad( object.geometry, object.materials );
+
+ }, onProgress, onError );
+
+ },
+
+ setPath: function ( value ) {
+
+ this.path = value;
+ return this;
+
+ },
+
+ setResourcePath: function ( value ) {
+
+ this.resourcePath = value;
+ return this;
+
+ },
+
+ setCrossOrigin: function ( value ) {
+
+ this.crossOrigin = value;
+ return this;
+
+ },
+
+ parse: ( function () {
+
+ function parseModel( json, geometry ) {
+
+ function isBitSet( value, position ) {
+
+ return value & ( 1 << position );
+
+ }
+
+ var i, j, fi,
+
+ offset, zLength,
+
+ colorIndex, normalIndex, uvIndex, materialIndex,
+
+ type,
+ isQuad,
+ hasMaterial,
+ hasFaceVertexUv,
+ hasFaceNormal, hasFaceVertexNormal,
+ hasFaceColor, hasFaceVertexColor,
+
+ vertex, face, faceA, faceB, hex, normal,
+
+ uvLayer, uv, u, v,
+
+ faces = json.faces,
+ vertices = json.vertices,
+ normals = json.normals,
+ colors = json.colors,
+
+ scale = json.scale,
+
+ nUvLayers = 0;
+
+
+ if ( json.uvs !== undefined ) {
+
+ // disregard empty arrays
+
+ for ( i = 0; i < json.uvs.length; i ++ ) {
+
+ if ( json.uvs[ i ].length ) nUvLayers ++;
+
+ }
+
+ for ( i = 0; i < nUvLayers; i ++ ) {
+
+ geometry.faceVertexUvs[ i ] = [];
+
+ }
+
+ }
+
+ offset = 0;
+ zLength = vertices.length;
+
+ while ( offset < zLength ) {
+
+ vertex = new THREE.Vector3();
+
+ vertex.x = vertices[ offset ++ ] * scale;
+ vertex.y = vertices[ offset ++ ] * scale;
+ vertex.z = vertices[ offset ++ ] * scale;
+
+ geometry.vertices.push( vertex );
+
+ }
+
+ offset = 0;
+ zLength = faces.length;
+
+ while ( offset < zLength ) {
+
+ type = faces[ offset ++ ];
+
+ isQuad = isBitSet( type, 0 );
+ hasMaterial = isBitSet( type, 1 );
+ hasFaceVertexUv = isBitSet( type, 3 );
+ hasFaceNormal = isBitSet( type, 4 );
+ hasFaceVertexNormal = isBitSet( type, 5 );
+ hasFaceColor = isBitSet( type, 6 );
+ hasFaceVertexColor = isBitSet( type, 7 );
+
+ // console.log("type", type, "bits", isQuad, hasMaterial, hasFaceVertexUv, hasFaceNormal, hasFaceVertexNormal, hasFaceColor, hasFaceVertexColor);
+
+ if ( isQuad ) {
+
+ faceA = new THREE.Face3();
+ faceA.a = faces[ offset ];
+ faceA.b = faces[ offset + 1 ];
+ faceA.c = faces[ offset + 3 ];
+
+ faceB = new THREE.Face3();
+ faceB.a = faces[ offset + 1 ];
+ faceB.b = faces[ offset + 2 ];
+ faceB.c = faces[ offset + 3 ];
+
+ offset += 4;
+
+ if ( hasMaterial ) {
+
+ materialIndex = faces[ offset ++ ];
+ faceA.materialIndex = materialIndex;
+ faceB.materialIndex = materialIndex;
+
+ }
+
+ // to get face <=> uv index correspondence
+
+ fi = geometry.faces.length;
+
+ if ( hasFaceVertexUv ) {
+
+ for ( i = 0; i < nUvLayers; i ++ ) {
+
+ uvLayer = json.uvs[ i ];
+
+ geometry.faceVertexUvs[ i ][ fi ] = [];
+ geometry.faceVertexUvs[ i ][ fi + 1 ] = [];
+
+ for ( j = 0; j < 4; j ++ ) {
+
+ uvIndex = faces[ offset ++ ];
+
+ u = uvLayer[ uvIndex * 2 ];
+ v = uvLayer[ uvIndex * 2 + 1 ];
+
+ uv = new THREE.Vector2( u, v );
+
+ if ( j !== 2 ) geometry.faceVertexUvs[ i ][ fi ].push( uv );
+ if ( j !== 0 ) geometry.faceVertexUvs[ i ][ fi + 1 ].push( uv );
+
+ }
+
+ }
+
+ }
+
+ if ( hasFaceNormal ) {
+
+ normalIndex = faces[ offset ++ ] * 3;
+
+ faceA.normal.set(
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ]
+ );
+
+ faceB.normal.copy( faceA.normal );
+
+ }
+
+ if ( hasFaceVertexNormal ) {
+
+ for ( i = 0; i < 4; i ++ ) {
+
+ normalIndex = faces[ offset ++ ] * 3;
+
+ normal = new THREE.Vector3(
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ]
+ );
+
+
+ if ( i !== 2 ) faceA.vertexNormals.push( normal );
+ if ( i !== 0 ) faceB.vertexNormals.push( normal );
+
+ }
+
+ }
+
+
+ if ( hasFaceColor ) {
+
+ colorIndex = faces[ offset ++ ];
+ hex = colors[ colorIndex ];
+
+ faceA.color.setHex( hex );
+ faceB.color.setHex( hex );
+
+ }
+
+
+ if ( hasFaceVertexColor ) {
+
+ for ( i = 0; i < 4; i ++ ) {
+
+ colorIndex = faces[ offset ++ ];
+ hex = colors[ colorIndex ];
+
+ if ( i !== 2 ) faceA.vertexColors.push( new THREE.Color( hex ) );
+ if ( i !== 0 ) faceB.vertexColors.push( new THREE.Color( hex ) );
+
+ }
+
+ }
+
+ geometry.faces.push( faceA );
+ geometry.faces.push( faceB );
+
+ } else {
+
+ face = new THREE.Face3();
+ face.a = faces[ offset ++ ];
+ face.b = faces[ offset ++ ];
+ face.c = faces[ offset ++ ];
+
+ if ( hasMaterial ) {
+
+ materialIndex = faces[ offset ++ ];
+ face.materialIndex = materialIndex;
+
+ }
+
+ // to get face <=> uv index correspondence
+
+ fi = geometry.faces.length;
+
+ if ( hasFaceVertexUv ) {
+
+ for ( i = 0; i < nUvLayers; i ++ ) {
+
+ uvLayer = json.uvs[ i ];
+
+ geometry.faceVertexUvs[ i ][ fi ] = [];
+
+ for ( j = 0; j < 3; j ++ ) {
+
+ uvIndex = faces[ offset ++ ];
+
+ u = uvLayer[ uvIndex * 2 ];
+ v = uvLayer[ uvIndex * 2 + 1 ];
+
+ uv = new THREE.Vector2( u, v );
+
+ geometry.faceVertexUvs[ i ][ fi ].push( uv );
+
+ }
+
+ }
+
+ }
+
+ if ( hasFaceNormal ) {
+
+ normalIndex = faces[ offset ++ ] * 3;
+
+ face.normal.set(
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ]
+ );
+
+ }
+
+ if ( hasFaceVertexNormal ) {
+
+ for ( i = 0; i < 3; i ++ ) {
+
+ normalIndex = faces[ offset ++ ] * 3;
+
+ normal = new THREE.Vector3(
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ++ ],
+ normals[ normalIndex ]
+ );
+
+ face.vertexNormals.push( normal );
+
+ }
+
+ }
+
+
+ if ( hasFaceColor ) {
+
+ colorIndex = faces[ offset ++ ];
+ face.color.setHex( colors[ colorIndex ] );
+
+ }
+
+
+ if ( hasFaceVertexColor ) {
+
+ for ( i = 0; i < 3; i ++ ) {
+
+ colorIndex = faces[ offset ++ ];
+ face.vertexColors.push( new THREE.Color( colors[ colorIndex ] ) );
+
+ }
+
+ }
+
+ geometry.faces.push( face );
+
+ }
+
+ }
+
+ }
+
+ function parseSkin( json, geometry ) {
+
+ var influencesPerVertex = ( json.influencesPerVertex !== undefined ) ? json.influencesPerVertex : 2;
+
+ if ( json.skinWeights ) {
+
+ for ( var i = 0, l = json.skinWeights.length; i < l; i += influencesPerVertex ) {
+
+ var x = json.skinWeights[ i ];
+ var y = ( influencesPerVertex > 1 ) ? json.skinWeights[ i + 1 ] : 0;
+ var z = ( influencesPerVertex > 2 ) ? json.skinWeights[ i + 2 ] : 0;
+ var w = ( influencesPerVertex > 3 ) ? json.skinWeights[ i + 3 ] : 0;
+
+ geometry.skinWeights.push( new THREE.Vector4( x, y, z, w ) );
+
+ }
+
+ }
+
+ if ( json.skinIndices ) {
+
+ for ( var i = 0, l = json.skinIndices.length; i < l; i += influencesPerVertex ) {
+
+ var a = json.skinIndices[ i ];
+ var b = ( influencesPerVertex > 1 ) ? json.skinIndices[ i + 1 ] : 0;
+ var c = ( influencesPerVertex > 2 ) ? json.skinIndices[ i + 2 ] : 0;
+ var d = ( influencesPerVertex > 3 ) ? json.skinIndices[ i + 3 ] : 0;
+
+ geometry.skinIndices.push( new THREE.Vector4( a, b, c, d ) );
+
+ }
+
+ }
+
+ geometry.bones = json.bones;
+
+ if ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) {
+
+ console.warn( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' +
+ geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' );
+
+ }
+
+ }
+
+ function parseMorphing( json, geometry ) {
+
+ var scale = json.scale;
+
+ if ( json.morphTargets !== undefined ) {
+
+ for ( var i = 0, l = json.morphTargets.length; i < l; i ++ ) {
+
+ geometry.morphTargets[ i ] = {};
+ geometry.morphTargets[ i ].name = json.morphTargets[ i ].name;
+ geometry.morphTargets[ i ].vertices = [];
+
+ var dstVertices = geometry.morphTargets[ i ].vertices;
+ var srcVertices = json.morphTargets[ i ].vertices;
+
+ for ( var v = 0, vl = srcVertices.length; v < vl; v += 3 ) {
+
+ var vertex = new THREE.Vector3();
+ vertex.x = srcVertices[ v ] * scale;
+ vertex.y = srcVertices[ v + 1 ] * scale;
+ vertex.z = srcVertices[ v + 2 ] * scale;
+
+ dstVertices.push( vertex );
+
+ }
+
+ }
+
+ }
+
+ if ( json.morphColors !== undefined && json.morphColors.length > 0 ) {
+
+ console.warn( 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.' );
+
+ var faces = geometry.faces;
+ var morphColors = json.morphColors[ 0 ].colors;
+
+ for ( var i = 0, l = faces.length; i < l; i ++ ) {
+
+ faces[ i ].color.fromArray( morphColors, i * 3 );
+
+ }
+
+ }
+
+ }
+
+ function parseAnimations( json, geometry ) {
+
+ var outputAnimations = [];
+
+ // parse old style Bone/Hierarchy animations
+ var animations = [];
+
+ if ( json.animation !== undefined ) {
+
+ animations.push( json.animation );
+
+ }
+
+ if ( json.animations !== undefined ) {
+
+ if ( json.animations.length ) {
+
+ animations = animations.concat( json.animations );
+
+ } else {
+
+ animations.push( json.animations );
+
+ }
+
+ }
+
+ for ( var i = 0; i < animations.length; i ++ ) {
+
+ var clip = THREE.AnimationClip.parseAnimation( animations[ i ], geometry.bones );
+ if ( clip ) outputAnimations.push( clip );
+
+ }
+
+ // parse implicit morph animations
+ if ( geometry.morphTargets ) {
+
+ // TODO: Figure out what an appropraite FPS is for morph target animations -- defaulting to 10, but really it is completely arbitrary.
+ var morphAnimationClips = THREE.AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 );
+ outputAnimations = outputAnimations.concat( morphAnimationClips );
+
+ }
+
+ if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations;
+
+ }
+
+ return function parse( json, path ) {
+
+ if ( json.data !== undefined ) {
+
+ // Geometry 4.0 spec
+ json = json.data;
+
+ }
+
+ if ( json.scale !== undefined ) {
+
+ json.scale = 1.0 / json.scale;
+
+ } else {
+
+ json.scale = 1.0;
+
+ }
+
+ var geometry = new THREE.Geometry();
+
+ parseModel( json, geometry );
+ parseSkin( json, geometry );
+ parseMorphing( json, geometry );
+ parseAnimations( json, geometry );
+
+ geometry.computeFaceNormals();
+ geometry.computeBoundingSphere();
+
+ if ( json.materials === undefined || json.materials.length === 0 ) {
+
+ return { geometry: geometry };
+
+ } else {
+
+ var materials = THREE.Loader.prototype.initMaterials( json.materials, this.resourcePath || path, this.crossOrigin );
+
+ return { geometry: geometry, materials: materials };
+
+ }
+
+ };
+
+ } )()
+
+ } );
+
+ return JSONLoader;
+
+} )(); | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | examples/webgl_loader_json.html | @@ -1,179 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>three.js webgl - loader -json</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <style>
- body {
- background:#777;
- padding:0;
- margin:0;
- font-weight: bold;
- overflow:hidden;
- }
-
- #info {
- position: absolute;
- top: 0px;
- width: 100%;
- color: #ffffff;
- padding: 5px;
- font-family:Monospace;
- font-size:13px;
- text-align:center;
- }
-
- a {
- color: #ffffff;
- }
- </style>
- </head>
- <body>
-
- <div id="container"></div>
- <div id="info">
- <a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> -
- monster by <a href="http://www.3drt.com/downloads.htm" target="_blank" rel="noopener">3drt</a>
- </div>
-
- <script src="../build/three.js"></script>
-
- <script src="js/WebGL.js"></script>
- <script src="js/libs/stats.min.js"></script>
-
- <script>
-
- if ( WEBGL.isWebGLAvailable() === false ) {
-
- document.body.appendChild( WEBGL.getWebGLErrorMessage() );
-
- }
-
- var container, stats, clock, mixer;
- var camera, scene, renderer;
-
- init();
- animate();
-
- function init() {
-
- container = document.getElementById( 'container' );
-
- camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 2000 );
- camera.position.set( 2, 4, 5 );
-
- clock = new THREE.Clock();
-
- scene = new THREE.Scene();
- scene.fog = new THREE.FogExp2( 0x000000, 0.035 );
-
- mixer = new THREE.AnimationMixer( scene );
-
- var loader = new THREE.JSONLoader();
- loader.load( 'models/json/legacy/monster/monster.js', function ( geometry, materials ) {
-
- // adjust color a bit
-
- var material = materials[ 0 ];
- material.morphTargets = true;
- material.color.setHex( 0xffaaaa );
-
- for ( var i = 0; i < 729; i ++ ) {
-
- var mesh = new THREE.Mesh( geometry, materials );
-
- // random placement in a grid
-
- var x = ( ( i % 27 ) - 13.5 ) * 2 + THREE.Math.randFloatSpread( 1 );
- var z = ( Math.floor( i / 27 ) - 13.5 ) * 2 + THREE.Math.randFloatSpread( 1 );
-
- mesh.position.set( x, 0, z );
-
- var s = THREE.Math.randFloat( 0.00075, 0.001 );
- mesh.scale.set( s, s, s );
-
- mesh.rotation.y = THREE.Math.randFloat( - 0.25, 0.25 );
-
- mesh.matrixAutoUpdate = false;
- mesh.updateMatrix();
-
- scene.add( mesh );
-
- mixer.clipAction( geometry.animations[ 0 ], mesh )
- .setDuration( 1 ) // one second
- .startAt( - Math.random() ) // random phase (already running)
- .play(); // let's go
-
- }
-
- } );
-
- // lights
-
- var ambientLight = new THREE.AmbientLight( 0xcccccc );
- scene.add( ambientLight );
-
- var pointLight = new THREE.PointLight( 0xff4400, 5, 30 );
- pointLight.position.set( 5, 0, 0 );
- scene.add( pointLight );
-
- // renderer
-
- renderer = new THREE.WebGLRenderer();
- renderer.setPixelRatio( window.devicePixelRatio );
- renderer.setSize( window.innerWidth, window.innerHeight );
- container.appendChild( renderer.domElement );
-
- // stats
-
- stats = new Stats();
- container.appendChild( stats.dom );
-
- // events
-
- window.addEventListener( 'resize', onWindowResize, false );
-
- }
-
- //
-
- function onWindowResize() {
-
- renderer.setSize( window.innerWidth, window.innerHeight );
-
- camera.aspect = window.innerWidth / window.innerHeight;
- camera.updateProjectionMatrix();
-
- }
-
- //
-
- function animate() {
-
- requestAnimationFrame( animate );
-
- render();
- stats.update();
-
- }
-
- function render() {
-
- var timer = Date.now() * 0.0005;
-
- camera.position.x = Math.cos( timer ) * 10;
- camera.position.y = 4;
- camera.position.z = Math.sin( timer ) * 10;
-
- mixer.update( clock.getDelta() );
-
- camera.lookAt( scene.position );
-
- renderer.render( scene, camera );
-
- }
-
- </script>
- </body>
-</html> | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | src/Three.Legacy.js | @@ -44,7 +44,6 @@ import { FileLoader } from './loaders/FileLoader.js';
import { AudioLoader } from './loaders/AudioLoader.js';
import { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
import { DataTextureLoader } from './loaders/DataTextureLoader.js';
-import { JSONLoader } from './loaders/JSONLoader.js';
import { ObjectLoader } from './loaders/ObjectLoader.js';
import { TextureLoader } from './loaders/TextureLoader.js';
import { Material } from './materials/Material.js';
@@ -437,17 +436,6 @@ export function BinaryTextureLoader( manager ) {
}
-Object.assign( JSONLoader.prototype, {
-
- setTexturePath: function ( value ) {
-
- console.warn( 'THREE.JSONLoader: .setTexturePath() has been renamed to .setResourcePath().' );
- return this.setResourcePath( value );
-
- }
-
-} );
-
Object.assign( ObjectLoader.prototype, {
setTexturePath: function ( value ) {
@@ -1893,6 +1881,14 @@ export function CanvasRenderer() {
//
+export function JSONLoader() {
+
+ console.error( 'THREE.JSONLoader has been removed.' );
+
+}
+
+//
+
export var SceneUtils = {
createMultiMaterialObject: function ( /* geometry, materials */ ) { | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | src/Three.js | @@ -40,7 +40,6 @@ export { ObjectLoader } from './loaders/ObjectLoader.js';
export { MaterialLoader } from './loaders/MaterialLoader.js';
export { BufferGeometryLoader } from './loaders/BufferGeometryLoader.js';
export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.js';
-export { JSONLoader } from './loaders/JSONLoader.js';
export { ImageLoader } from './loaders/ImageLoader.js';
export { ImageBitmapLoader } from './loaders/ImageBitmapLoader.js';
export { FontLoader } from './loaders/FontLoader.js'; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | src/loaders/JSONLoader.js | @@ -1,587 +0,0 @@
-import { Loader } from './Loader.js';
-import { LoaderUtils } from './LoaderUtils.js';
-import { AnimationClip } from '../animation/AnimationClip.js';
-import { Vector3 } from '../math/Vector3.js';
-import { Vector4 } from '../math/Vector4.js';
-import { Color } from '../math/Color.js';
-import { Vector2 } from '../math/Vector2.js';
-import { Face3 } from '../core/Face3.js';
-import { Geometry } from '../core/Geometry.js';
-import { FileLoader } from './FileLoader.js';
-import { DefaultLoadingManager } from './LoadingManager.js';
-
-/**
- * @author mrdoob / http://mrdoob.com/
- * @author alteredq / http://alteredqualia.com/
- */
-
-function JSONLoader( manager ) {
-
- if ( typeof manager === 'boolean' ) {
-
- console.warn( 'THREE.JSONLoader: showStatus parameter has been removed from constructor.' );
- manager = undefined;
-
- }
-
- this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
-
- this.withCredentials = false;
-
-}
-
-Object.assign( JSONLoader.prototype, {
-
- crossOrigin: 'anonymous',
-
- load: function ( url, onLoad, onProgress, onError ) {
-
- var scope = this;
-
- var path = ( this.path === undefined ) ? LoaderUtils.extractUrlBase( url ) : this.path;
-
- var loader = new FileLoader( this.manager );
- loader.setPath( this.path );
- loader.setWithCredentials( this.withCredentials );
- loader.load( url, function ( text ) {
-
- var json = JSON.parse( text );
- var metadata = json.metadata;
-
- if ( metadata !== undefined ) {
-
- var type = metadata.type;
-
- if ( type !== undefined ) {
-
- if ( type.toLowerCase() === 'object' ) {
-
- console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' );
- return;
-
- }
-
- }
-
- }
-
- var object = scope.parse( json, path );
- onLoad( object.geometry, object.materials );
-
- }, onProgress, onError );
-
- },
-
- setPath: function ( value ) {
-
- this.path = value;
- return this;
-
- },
-
- setResourcePath: function ( value ) {
-
- this.resourcePath = value;
- return this;
-
- },
-
- setCrossOrigin: function ( value ) {
-
- this.crossOrigin = value;
- return this;
-
- },
-
- parse: ( function () {
-
- function parseModel( json, geometry ) {
-
- function isBitSet( value, position ) {
-
- return value & ( 1 << position );
-
- }
-
- var i, j, fi,
-
- offset, zLength,
-
- colorIndex, normalIndex, uvIndex, materialIndex,
-
- type,
- isQuad,
- hasMaterial,
- hasFaceVertexUv,
- hasFaceNormal, hasFaceVertexNormal,
- hasFaceColor, hasFaceVertexColor,
-
- vertex, face, faceA, faceB, hex, normal,
-
- uvLayer, uv, u, v,
-
- faces = json.faces,
- vertices = json.vertices,
- normals = json.normals,
- colors = json.colors,
-
- scale = json.scale,
-
- nUvLayers = 0;
-
-
- if ( json.uvs !== undefined ) {
-
- // disregard empty arrays
-
- for ( i = 0; i < json.uvs.length; i ++ ) {
-
- if ( json.uvs[ i ].length ) nUvLayers ++;
-
- }
-
- for ( i = 0; i < nUvLayers; i ++ ) {
-
- geometry.faceVertexUvs[ i ] = [];
-
- }
-
- }
-
- offset = 0;
- zLength = vertices.length;
-
- while ( offset < zLength ) {
-
- vertex = new Vector3();
-
- vertex.x = vertices[ offset ++ ] * scale;
- vertex.y = vertices[ offset ++ ] * scale;
- vertex.z = vertices[ offset ++ ] * scale;
-
- geometry.vertices.push( vertex );
-
- }
-
- offset = 0;
- zLength = faces.length;
-
- while ( offset < zLength ) {
-
- type = faces[ offset ++ ];
-
- isQuad = isBitSet( type, 0 );
- hasMaterial = isBitSet( type, 1 );
- hasFaceVertexUv = isBitSet( type, 3 );
- hasFaceNormal = isBitSet( type, 4 );
- hasFaceVertexNormal = isBitSet( type, 5 );
- hasFaceColor = isBitSet( type, 6 );
- hasFaceVertexColor = isBitSet( type, 7 );
-
- // console.log("type", type, "bits", isQuad, hasMaterial, hasFaceVertexUv, hasFaceNormal, hasFaceVertexNormal, hasFaceColor, hasFaceVertexColor);
-
- if ( isQuad ) {
-
- faceA = new Face3();
- faceA.a = faces[ offset ];
- faceA.b = faces[ offset + 1 ];
- faceA.c = faces[ offset + 3 ];
-
- faceB = new Face3();
- faceB.a = faces[ offset + 1 ];
- faceB.b = faces[ offset + 2 ];
- faceB.c = faces[ offset + 3 ];
-
- offset += 4;
-
- if ( hasMaterial ) {
-
- materialIndex = faces[ offset ++ ];
- faceA.materialIndex = materialIndex;
- faceB.materialIndex = materialIndex;
-
- }
-
- // to get face <=> uv index correspondence
-
- fi = geometry.faces.length;
-
- if ( hasFaceVertexUv ) {
-
- for ( i = 0; i < nUvLayers; i ++ ) {
-
- uvLayer = json.uvs[ i ];
-
- geometry.faceVertexUvs[ i ][ fi ] = [];
- geometry.faceVertexUvs[ i ][ fi + 1 ] = [];
-
- for ( j = 0; j < 4; j ++ ) {
-
- uvIndex = faces[ offset ++ ];
-
- u = uvLayer[ uvIndex * 2 ];
- v = uvLayer[ uvIndex * 2 + 1 ];
-
- uv = new Vector2( u, v );
-
- if ( j !== 2 ) geometry.faceVertexUvs[ i ][ fi ].push( uv );
- if ( j !== 0 ) geometry.faceVertexUvs[ i ][ fi + 1 ].push( uv );
-
- }
-
- }
-
- }
-
- if ( hasFaceNormal ) {
-
- normalIndex = faces[ offset ++ ] * 3;
-
- faceA.normal.set(
- normals[ normalIndex ++ ],
- normals[ normalIndex ++ ],
- normals[ normalIndex ]
- );
-
- faceB.normal.copy( faceA.normal );
-
- }
-
- if ( hasFaceVertexNormal ) {
-
- for ( i = 0; i < 4; i ++ ) {
-
- normalIndex = faces[ offset ++ ] * 3;
-
- normal = new Vector3(
- normals[ normalIndex ++ ],
- normals[ normalIndex ++ ],
- normals[ normalIndex ]
- );
-
-
- if ( i !== 2 ) faceA.vertexNormals.push( normal );
- if ( i !== 0 ) faceB.vertexNormals.push( normal );
-
- }
-
- }
-
-
- if ( hasFaceColor ) {
-
- colorIndex = faces[ offset ++ ];
- hex = colors[ colorIndex ];
-
- faceA.color.setHex( hex );
- faceB.color.setHex( hex );
-
- }
-
-
- if ( hasFaceVertexColor ) {
-
- for ( i = 0; i < 4; i ++ ) {
-
- colorIndex = faces[ offset ++ ];
- hex = colors[ colorIndex ];
-
- if ( i !== 2 ) faceA.vertexColors.push( new Color( hex ) );
- if ( i !== 0 ) faceB.vertexColors.push( new Color( hex ) );
-
- }
-
- }
-
- geometry.faces.push( faceA );
- geometry.faces.push( faceB );
-
- } else {
-
- face = new Face3();
- face.a = faces[ offset ++ ];
- face.b = faces[ offset ++ ];
- face.c = faces[ offset ++ ];
-
- if ( hasMaterial ) {
-
- materialIndex = faces[ offset ++ ];
- face.materialIndex = materialIndex;
-
- }
-
- // to get face <=> uv index correspondence
-
- fi = geometry.faces.length;
-
- if ( hasFaceVertexUv ) {
-
- for ( i = 0; i < nUvLayers; i ++ ) {
-
- uvLayer = json.uvs[ i ];
-
- geometry.faceVertexUvs[ i ][ fi ] = [];
-
- for ( j = 0; j < 3; j ++ ) {
-
- uvIndex = faces[ offset ++ ];
-
- u = uvLayer[ uvIndex * 2 ];
- v = uvLayer[ uvIndex * 2 + 1 ];
-
- uv = new Vector2( u, v );
-
- geometry.faceVertexUvs[ i ][ fi ].push( uv );
-
- }
-
- }
-
- }
-
- if ( hasFaceNormal ) {
-
- normalIndex = faces[ offset ++ ] * 3;
-
- face.normal.set(
- normals[ normalIndex ++ ],
- normals[ normalIndex ++ ],
- normals[ normalIndex ]
- );
-
- }
-
- if ( hasFaceVertexNormal ) {
-
- for ( i = 0; i < 3; i ++ ) {
-
- normalIndex = faces[ offset ++ ] * 3;
-
- normal = new Vector3(
- normals[ normalIndex ++ ],
- normals[ normalIndex ++ ],
- normals[ normalIndex ]
- );
-
- face.vertexNormals.push( normal );
-
- }
-
- }
-
-
- if ( hasFaceColor ) {
-
- colorIndex = faces[ offset ++ ];
- face.color.setHex( colors[ colorIndex ] );
-
- }
-
-
- if ( hasFaceVertexColor ) {
-
- for ( i = 0; i < 3; i ++ ) {
-
- colorIndex = faces[ offset ++ ];
- face.vertexColors.push( new Color( colors[ colorIndex ] ) );
-
- }
-
- }
-
- geometry.faces.push( face );
-
- }
-
- }
-
- }
-
- function parseSkin( json, geometry ) {
-
- var influencesPerVertex = ( json.influencesPerVertex !== undefined ) ? json.influencesPerVertex : 2;
-
- if ( json.skinWeights ) {
-
- for ( var i = 0, l = json.skinWeights.length; i < l; i += influencesPerVertex ) {
-
- var x = json.skinWeights[ i ];
- var y = ( influencesPerVertex > 1 ) ? json.skinWeights[ i + 1 ] : 0;
- var z = ( influencesPerVertex > 2 ) ? json.skinWeights[ i + 2 ] : 0;
- var w = ( influencesPerVertex > 3 ) ? json.skinWeights[ i + 3 ] : 0;
-
- geometry.skinWeights.push( new Vector4( x, y, z, w ) );
-
- }
-
- }
-
- if ( json.skinIndices ) {
-
- for ( var i = 0, l = json.skinIndices.length; i < l; i += influencesPerVertex ) {
-
- var a = json.skinIndices[ i ];
- var b = ( influencesPerVertex > 1 ) ? json.skinIndices[ i + 1 ] : 0;
- var c = ( influencesPerVertex > 2 ) ? json.skinIndices[ i + 2 ] : 0;
- var d = ( influencesPerVertex > 3 ) ? json.skinIndices[ i + 3 ] : 0;
-
- geometry.skinIndices.push( new Vector4( a, b, c, d ) );
-
- }
-
- }
-
- geometry.bones = json.bones;
-
- if ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) {
-
- console.warn( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' +
- geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' );
-
- }
-
- }
-
- function parseMorphing( json, geometry ) {
-
- var scale = json.scale;
-
- if ( json.morphTargets !== undefined ) {
-
- for ( var i = 0, l = json.morphTargets.length; i < l; i ++ ) {
-
- geometry.morphTargets[ i ] = {};
- geometry.morphTargets[ i ].name = json.morphTargets[ i ].name;
- geometry.morphTargets[ i ].vertices = [];
-
- var dstVertices = geometry.morphTargets[ i ].vertices;
- var srcVertices = json.morphTargets[ i ].vertices;
-
- for ( var v = 0, vl = srcVertices.length; v < vl; v += 3 ) {
-
- var vertex = new Vector3();
- vertex.x = srcVertices[ v ] * scale;
- vertex.y = srcVertices[ v + 1 ] * scale;
- vertex.z = srcVertices[ v + 2 ] * scale;
-
- dstVertices.push( vertex );
-
- }
-
- }
-
- }
-
- if ( json.morphColors !== undefined && json.morphColors.length > 0 ) {
-
- console.warn( 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.' );
-
- var faces = geometry.faces;
- var morphColors = json.morphColors[ 0 ].colors;
-
- for ( var i = 0, l = faces.length; i < l; i ++ ) {
-
- faces[ i ].color.fromArray( morphColors, i * 3 );
-
- }
-
- }
-
- }
-
- function parseAnimations( json, geometry ) {
-
- var outputAnimations = [];
-
- // parse old style Bone/Hierarchy animations
- var animations = [];
-
- if ( json.animation !== undefined ) {
-
- animations.push( json.animation );
-
- }
-
- if ( json.animations !== undefined ) {
-
- if ( json.animations.length ) {
-
- animations = animations.concat( json.animations );
-
- } else {
-
- animations.push( json.animations );
-
- }
-
- }
-
- for ( var i = 0; i < animations.length; i ++ ) {
-
- var clip = AnimationClip.parseAnimation( animations[ i ], geometry.bones );
- if ( clip ) outputAnimations.push( clip );
-
- }
-
- // parse implicit morph animations
- if ( geometry.morphTargets ) {
-
- // TODO: Figure out what an appropraite FPS is for morph target animations -- defaulting to 10, but really it is completely arbitrary.
- var morphAnimationClips = AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 );
- outputAnimations = outputAnimations.concat( morphAnimationClips );
-
- }
-
- if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations;
-
- }
-
- return function parse( json, path ) {
-
- if ( json.data !== undefined ) {
-
- // Geometry 4.0 spec
- json = json.data;
-
- }
-
- if ( json.scale !== undefined ) {
-
- json.scale = 1.0 / json.scale;
-
- } else {
-
- json.scale = 1.0;
-
- }
-
- var geometry = new Geometry();
-
- parseModel( json, geometry );
- parseSkin( json, geometry );
- parseMorphing( json, geometry );
- parseAnimations( json, geometry );
-
- geometry.computeFaceNormals();
- geometry.computeBoundingSphere();
-
- if ( json.materials === undefined || json.materials.length === 0 ) {
-
- return { geometry: geometry };
-
- } else {
-
- var materials = Loader.prototype.initMaterials( json.materials, this.resourcePath || path, this.crossOrigin );
-
- return { geometry: geometry, materials: materials };
-
- }
-
- };
-
- } )()
-
-} );
-
-
-export { JSONLoader }; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | src/loaders/ObjectLoader.js | @@ -50,7 +50,6 @@ import { AnimationClip } from '../animation/AnimationClip.js';
import { MaterialLoader } from './MaterialLoader.js';
import { LoaderUtils } from './LoaderUtils.js';
import { BufferGeometryLoader } from './BufferGeometryLoader.js';
-import { JSONLoader } from './JSONLoader.js';
import { FileLoader } from './FileLoader.js';
import * as Geometries from '../geometries/Geometries.js';
import * as Curves from '../extras/curves/Curves.js';
@@ -101,7 +100,7 @@ Object.assign( ObjectLoader.prototype, {
if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {
- console.error( 'THREE.ObjectLoader: Can\'t load ' + url + '. Use THREE.JSONLoader instead.' );
+ console.error( 'THREE.ObjectLoader: Can\'t load ' + url );
return;
}
@@ -191,7 +190,6 @@ Object.assign( ObjectLoader.prototype, {
if ( json !== undefined ) {
- var geometryLoader = new JSONLoader();
var bufferGeometryLoader = new BufferGeometryLoader();
for ( var i = 0, l = json.length; i < l; i ++ ) {
@@ -424,7 +422,7 @@ Object.assign( ObjectLoader.prototype, {
case 'Geometry':
- geometry = geometryLoader.parse( data, this.resourcePath ).geometry;
+ console.error( 'THREE.ObjectLoader: "Geometry" is no longer supported.' );
break;
| true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/three.source.unit.js | @@ -161,7 +161,6 @@ import './unit/src/loaders/DataTextureLoader.tests';
import './unit/src/loaders/FileLoader.tests';
import './unit/src/loaders/FontLoader.tests';
import './unit/src/loaders/ImageLoader.tests';
-import './unit/src/loaders/JSONLoader.tests';
import './unit/src/loaders/Loader.tests';
import './unit/src/loaders/LoaderUtils.tests';
import './unit/src/loaders/LoadingManager.tests'; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/BoxGeometry.tests.js | @@ -6,57 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- BoxGeometry,
BoxBufferGeometry
} from '../../../../src/geometries/BoxGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'BoxGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- width: 10,
- height: 20,
- depth: 30,
- widthSegments: 2,
- heightSegments: 3,
- depthSegments: 4
- };
-
- geometries = [
- new BoxGeometry(),
- new BoxGeometry( parameters.width, parameters.height, parameters.depth ),
- new BoxGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments )
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'BoxBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/CircleGeometry.tests.js | @@ -6,57 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- CircleGeometry,
CircleBufferGeometry
} from '../../../../src/geometries/CircleGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'CircleGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- segments: 20,
- thetaStart: 0.1,
- thetaLength: 0.2
- };
-
- geometries = [
- new CircleGeometry(),
- new CircleGeometry( parameters.radius ),
- new CircleGeometry( parameters.radius, parameters.segments ),
- new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart ),
- new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'CircleBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/ConeGeometry.tests.js | @@ -5,46 +5,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- ConeGeometry,
ConeBufferGeometry
} from '../../../../src/geometries/ConeGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'ConeGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- geometries = [
- new ConeGeometry()
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'ConeBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/CylinderGeometry.tests.js | @@ -6,65 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- CylinderGeometry,
CylinderBufferGeometry
} from '../../../../src/geometries/CylinderGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'CylinderGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radiusTop: 10,
- radiusBottom: 20,
- height: 30,
- radialSegments: 20,
- heightSegments: 30,
- openEnded: true,
- thetaStart: 0.1,
- thetaLength: 2.0,
- };
-
- geometries = [
- new CylinderGeometry(),
- new CylinderGeometry( parameters.radiusTop ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ),
- new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'CylinderBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/DodecahedronGeometry.tests.js | @@ -6,53 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- DodecahedronGeometry,
DodecahedronBufferGeometry
} from '../../../../src/geometries/DodecahedronGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'CircleGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- detail: undefined
- };
-
- geometries = [
- new DodecahedronGeometry(),
- new DodecahedronGeometry( parameters.radius ),
- new DodecahedronGeometry( parameters.radius, parameters.detail ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'CircleBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/ExtrudeGeometry.tests.js | @@ -3,28 +3,10 @@
*/
/* global QUnit */
-import { ExtrudeGeometry, ExtrudeBufferGeometry } from '../../../../src/geometries/ExtrudeGeometry';
+import { ExtrudeBufferGeometry } from '../../../../src/geometries/ExtrudeGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'ExtrudeGeometry', () => {
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- } );
-
QUnit.module( 'ExtrudeBufferGeometry', () => {
// INHERITANCE | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/IcosahedronGeometry.tests.js | @@ -6,53 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- IcosahedronGeometry,
IcosahedronBufferGeometry
} from '../../../../src/geometries/IcosahedronGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'IcosahedronGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- detail: undefined
- };
-
- geometries = [
- new IcosahedronGeometry(),
- new IcosahedronGeometry( parameters.radius ),
- new IcosahedronGeometry( parameters.radius, parameters.detail ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'IcosahedronBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/LatheGeometry.tests.js | @@ -5,54 +5,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- LatheGeometry,
LatheBufferGeometry
} from '../../../../src/geometries/LatheGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'LatheGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- points: [],
- segments: 0,
- phiStart: 0,
- phiLength: 0
- };
-
- geometries = [
- // new LatheGeometry(), // Todo: error for undefined point
- new LatheGeometry( parameters.points )
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'LatheBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/OctahedronGeometry.tests.js | @@ -6,53 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- OctahedronGeometry,
OctahedronBufferGeometry
} from '../../../../src/geometries/OctahedronGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'OctahedronGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- detail: undefined
- };
-
- geometries = [
- new OctahedronGeometry(),
- new OctahedronGeometry( parameters.radius ),
- new OctahedronGeometry( parameters.radius, parameters.detail ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'OctahedronBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/ParametricGeometry.tests.js | @@ -4,46 +4,11 @@
/* global QUnit */
import {
- ParametricGeometry,
ParametricBufferGeometry
} from '../../../../src/geometries/ParametricGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'ParametricGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- geometries = [
- new ParametricGeometry()
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.todo( 'Standard geometry tests', ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- } );
-
QUnit.module( 'ParametricBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/PlaneGeometry.tests.js | @@ -6,57 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- PlaneGeometry,
PlaneBufferGeometry
} from '../../../../src/geometries/PlaneGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'PlaneGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- width: 10,
- height: 30,
- widthSegments: 3,
- heightSegments: 5
- };
-
- geometries = [
- new PlaneGeometry(),
- new PlaneGeometry( parameters.width ),
- new PlaneGeometry( parameters.width, parameters.height ),
- new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ),
- new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'PlaneBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/PolyhedronGeometry.tests.js | @@ -5,54 +5,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- PolyhedronGeometry,
PolyhedronBufferGeometry
} from '../../../../src/geometries/PolyhedronGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'PolyhedronGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- var vertices = [
- 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1
- ];
-
- var indices = [
- 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1
- ];
-
- geometries = [
- new PolyhedronGeometry( vertices, indices )
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'PolyhedronBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/RingGeometry.tests.js | @@ -6,61 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- RingGeometry,
RingBufferGeometry
} from '../../../../src/geometries/RingGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'RingGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- innerRadius: 10,
- outerRadius: 60,
- thetaSegments: 12,
- phiSegments: 14,
- thetaStart: 0.1,
- thetaLength: 2.0
- };
-
- geometries = [
- new RingGeometry(),
- new RingGeometry( parameters.innerRadius ),
- new RingGeometry( parameters.innerRadius, parameters.outerRadius ),
- new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments ),
- new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ),
- new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ),
- new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'RingBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/ShapeGeometry.tests.js | @@ -4,53 +4,13 @@
/* global QUnit */
import {
- ShapeGeometry,
ShapeBufferGeometry
} from '../../../../src/geometries/ShapeGeometry';
import { Shape } from '../../../../src/extras/core/Shape';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'ShapeGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- var triangleShape = new Shape();
- triangleShape.moveTo( 0, - 1 );
- triangleShape.lineTo( 1, 1 );
- triangleShape.lineTo( - 1, 1 );
-
- geometries = [
- new ShapeGeometry( triangleShape )
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.todo( 'Standard geometry tests', ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- } );
-
QUnit.module( 'ShapeBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/SphereGeometry.tests.js | @@ -6,63 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- SphereGeometry,
SphereBufferGeometry
} from '../../../../src/geometries/SphereGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'SphereGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- widthSegments: 20,
- heightSegments: 30,
- phiStart: 0.5,
- phiLength: 1.0,
- thetaStart: 0.4,
- thetaLength: 2.0,
- };
-
- geometries = [
- new SphereGeometry(),
- new SphereGeometry( parameters.radius ),
- new SphereGeometry( parameters.radius, parameters.widthSegments ),
- new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ),
- new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ),
- new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ),
- new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ),
- new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'SphereBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/TetrahedronGeometry.tests.js | @@ -6,7 +6,6 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- TetrahedronGeometry,
TetrahedronBufferGeometry
} from '../../../../src/geometries/TetrahedronGeometry';
@@ -23,9 +22,9 @@ export default QUnit.module( 'Geometries', () => {
};
geometries = [
- new TetrahedronGeometry(),
- new TetrahedronGeometry( parameters.radius ),
- new TetrahedronGeometry( parameters.radius, parameters.detail )
+ new TetrahedronBufferGeometry(),
+ new TetrahedronBufferGeometry( parameters.radius ),
+ new TetrahedronBufferGeometry( parameters.radius, parameters.detail )
];
} ); | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/TextGeometry.tests.js | @@ -4,46 +4,11 @@
/* global QUnit */
import {
- TextGeometry,
TextBufferGeometry
} from '../../../../src/geometries/TextGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'TextGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- geometries = [
- new TextGeometry()
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.todo( 'Standard geometry tests', ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- } );
-
QUnit.module( 'TextBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/TorusGeometry.tests.js | @@ -6,59 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- TorusGeometry,
TorusBufferGeometry
} from '../../../../src/geometries/TorusGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'TorusGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- tube: 20,
- radialSegments: 30,
- tubularSegments: 10,
- arc: 2.0,
- };
-
- geometries = [
- new TorusGeometry(),
- new TorusGeometry( parameters.radius ),
- new TorusGeometry( parameters.radius, parameters.tube ),
- new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments ),
- new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ),
- new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'TorusBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/TorusKnotGeometry.tests.js | @@ -6,60 +6,11 @@
import { runStdGeometryTests } from '../../qunit-utils';
import {
- TorusKnotGeometry,
TorusKnotBufferGeometry
} from '../../../../src/geometries/TorusKnotGeometry';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'SphereGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- const parameters = {
- radius: 10,
- tube: 20,
- tubularSegments: 30,
- radialSegments: 10,
- p: 3,
- q: 2
- };
-
- geometries = [
- new TorusKnotGeometry(),
- new TorusKnotGeometry( parameters.radius ),
- new TorusKnotGeometry( parameters.radius, parameters.tube ),
- new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ),
- new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ),
- new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ),
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.test( 'Standard geometry tests', ( assert ) => {
-
- runStdGeometryTests( assert, geometries );
-
- } );
-
- } );
-
QUnit.module( 'TorusKnotBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/geometries/TubeGeometry.tests.js | @@ -4,7 +4,6 @@
/* global QUnit */
import {
- TubeGeometry,
TubeBufferGeometry
} from '../../../../src/geometries/TubeGeometry';
@@ -13,42 +12,6 @@ import { Vector3 } from '../../../../src/math/Vector3';
export default QUnit.module( 'Geometries', () => {
- QUnit.module( 'TubeGeometry', ( hooks ) => {
-
- var geometries = undefined;
- hooks.beforeEach( function () {
-
- var path = new LineCurve3( new Vector3( 0, 0, 0 ), new Vector3( 0, 1, 0 ) );
-
- geometries = [
- new TubeGeometry( path )
- ];
-
- } );
-
- // INHERITANCE
- QUnit.todo( "Extending", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // OTHERS
- QUnit.todo( 'Standard geometry tests', ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- } );
-
QUnit.module( 'TubeBufferGeometry', ( hooks ) => {
var geometries = undefined; | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | test/unit/src/loaders/JSONLoader.tests.js | @@ -1,40 +0,0 @@
-/**
- * @author TristanVALCKE / https://github.com/Itee
- */
-/* global QUnit */
-
-import { JSONLoader } from '../../../../src/loaders/JSONLoader';
-
-export default QUnit.module( 'Loaders', () => {
-
- QUnit.module( 'JSONLoader', () => {
-
- // INSTANCING
- QUnit.todo( "Instancing", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- // PUBLIC STUFF
- QUnit.todo( "load", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- QUnit.todo( "setTexturePath", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- QUnit.todo( "parse", ( assert ) => {
-
- assert.ok( false, "everything's gonna be alright" );
-
- } );
-
- } );
-
-} ); | true |
Other | mrdoob | three.js | 02d91338ea0dd6bb939a04f3d3b6af6591d2f391.json | Remove JSONLoader from core | utils/exporters/blender/README.md | @@ -1,3 +1,3 @@
# Three.js Blender Export
-> **NOTICE:** The Blender exporter for the Three.js JSON format has been removed, to focus on better support for other workflows. For recommended alternatives, see [Loading 3D Models](https://threejs.org/docs/#manual/introduction/Loading-3D-models). The Three.js JSON format is still fully supported for use with [Object3D.toJSON](https://threejs.org/docs/#api/core/Object3D.toJSON), the [Editor](https://threejs.org/editor/), [THREE.ObjectLoader](https://threejs.org/docs/#api/loaders/ObjectLoader), [THREE.JSONLoader](https://threejs.org/docs/#api/loaders/JSONLoader), and [converters](https://github.com/mrdoob/three.js/tree/dev/utils/converters).
+> **NOTICE:** The Blender exporter for the Three.js JSON format has been removed, to focus on better support for other workflows. For recommended alternatives, see [Loading 3D Models](https://threejs.org/docs/#manual/introduction/Loading-3D-models). The Three.js Object/Scene JSON format is still fully supported for use with [Object3D.toJSON](https://threejs.org/docs/#api/core/Object3D.toJSON), the [Editor](https://threejs.org/editor/), [THREE.ObjectLoader](https://threejs.org/docs/#api/loaders/ObjectLoader) and [converters](https://github.com/mrdoob/three.js/tree/dev/utils/converters). | true |
Other | mrdoob | three.js | 9614c891972632ec8bbd33667e8024a144fe64d7.json | serialize userData in GLTFExporter | examples/js/exporters/GLTFExporter.js | @@ -1666,6 +1666,12 @@ THREE.GLTFExporter.prototype = {
}
+ if ( scene.userData && Object.keys( scene.userData ).length > 0 ) {
+
+ gltfScene.extras = serializeUserData( scene );
+
+ }
+
outputJSON.scenes.push( gltfScene );
var nodes = []; | false |
Other | mrdoob | three.js | dfd536f1fa82dd353b6095caa2c719c61c194bb4.json | Update variable name | examples/webgl_tonemapping.html | @@ -74,7 +74,7 @@
Reinhard: THREE.ReinhardToneMapping,
Uncharted2: THREE.Uncharted2ToneMapping,
Cineon: THREE.CineonToneMapping,
- ACESFilm: THREE.ACESFilmicToneMapping
+ ACESFilmic: THREE.ACESFilmicToneMapping
};
var camera, scene, renderer, group; | false |
Other | mrdoob | three.js | fbce5eb12dd71405c70f9318315c2289f746ac81.json | Update variable name | examples/webgl_tonemapping.html | @@ -74,7 +74,7 @@
Reinhard: THREE.ReinhardToneMapping,
Uncharted2: THREE.Uncharted2ToneMapping,
Cineon: THREE.CineonToneMapping,
- ACESFilm: THREE.ACESFilmToneMapping
+ ACESFilm: THREE.ACESFilmicToneMapping
};
var camera, scene, renderer, group; | true |
Other | mrdoob | three.js | fbce5eb12dd71405c70f9318315c2289f746ac81.json | Update variable name | src/constants.js | @@ -55,7 +55,7 @@ export var LinearToneMapping = 1;
export var ReinhardToneMapping = 2;
export var Uncharted2ToneMapping = 3;
export var CineonToneMapping = 4;
-export var ACESFilmToneMapping = 5;
+export var ACESFilmicToneMapping = 5;
export var UVMapping = 300;
export var CubeReflectionMapping = 301;
export var CubeRefractionMapping = 302; | true |
Other | mrdoob | three.js | fbce5eb12dd71405c70f9318315c2289f746ac81.json | Update variable name | src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl | @@ -41,7 +41,7 @@ vec3 OptimizedCineonToneMapping( vec3 color ) {
}
// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
-vec3 ACESFilmToneMapping( vec3 color ) {
+vec3 ACESFilmicToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) ); | true |
Other | mrdoob | three.js | fbce5eb12dd71405c70f9318315c2289f746ac81.json | Update variable name | src/renderers/webgl/WebGLProgram.js | @@ -5,7 +5,7 @@
import { WebGLUniforms } from './WebGLUniforms.js';
import { WebGLShader } from './WebGLShader.js';
import { ShaderChunk } from '../shaders/ShaderChunk.js';
-import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, EquirectangularRefractionMapping, CubeRefractionMapping, SphericalReflectionMapping, EquirectangularReflectionMapping, CubeUVRefractionMapping, CubeUVReflectionMapping, CubeReflectionMapping, PCFSoftShadowMap, PCFShadowMap, ACESFilmToneMapping, CineonToneMapping, Uncharted2ToneMapping, ReinhardToneMapping, LinearToneMapping, GammaEncoding, RGBDEncoding, RGBM16Encoding, RGBM7Encoding, RGBEEncoding, sRGBEncoding, LinearEncoding } from '../../constants.js';
+import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, EquirectangularRefractionMapping, CubeRefractionMapping, SphericalReflectionMapping, EquirectangularReflectionMapping, CubeUVRefractionMapping, CubeUVReflectionMapping, CubeReflectionMapping, PCFSoftShadowMap, PCFShadowMap, ACESFilmicToneMapping, CineonToneMapping, Uncharted2ToneMapping, ReinhardToneMapping, LinearToneMapping, GammaEncoding, RGBDEncoding, RGBM16Encoding, RGBM7Encoding, RGBEEncoding, sRGBEncoding, LinearEncoding } from '../../constants.js';
var programIdCount = 0;
@@ -70,8 +70,8 @@ function getToneMappingFunction( functionName, toneMapping ) {
toneMappingName = 'OptimizedCineon';
break;
- case ACESFilmToneMapping:
- toneMappingName = 'ACESFilm';
+ case ACESFilmicToneMapping:
+ toneMappingName = 'ACESFilmic';
break;
default: | true |
Other | mrdoob | three.js | a2d4580c66fdd9d577f96f67073692db49d5aa57.json | Update description and globe geometry radius | examples/webgl_lights_physical.html | @@ -36,7 +36,7 @@
<div id="container"></div>
<div id="info">
<a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> - Physically accurate lighting example using a incandescent bulb - by <a href="http://clara.io" target="_blank" rel="noopener">Ben Houston</a><br />
- Using real world scale: Brick cube is 1 meter in size. Light is 2 meters from floor. Globe is 25 cm in diameter.<br/>
+ Using real world scale: Brick cube is 50 cm in size. Globe is 50 cm in diameter.<br/>
Using Reinhard inline tonemapping with real-world light falloff (decay = 2).
</div>
@@ -218,9 +218,9 @@
floorMesh.rotation.x = - Math.PI / 2.0;
scene.add( floorMesh );
- var ballGeometry = new THREE.SphereBufferGeometry( 0.5, 32, 32 );
+ var ballGeometry = new THREE.SphereBufferGeometry( 0.25, 32, 32 );
var ballMesh = new THREE.Mesh( ballGeometry, ballMat );
- ballMesh.position.set( 1, 0.5, 1 );
+ ballMesh.position.set( 1, 0.25, 1 );
ballMesh.rotation.y = Math.PI;
ballMesh.castShadow = true;
scene.add( ballMesh ); | false |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | docs/api/en/materials/Material.html | @@ -175,13 +175,6 @@ <h3>[property:Float opacity]</h3>
Default is *1.0*.
</p>
- <h3>[property:Float overdraw]</h3>
- <p>
- Amount of triangle expansion at draw time.
- This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer].
- *0.5* tends to give good results across browsers. Default is *0*.
- </p>
-
<h3>[property:Boolean polygonOffset]</h3>
<p>
Whether to use polygon offset. Default is *false*. This corresponds to the *GL_POLYGON_OFFSET_FILL* WebGL feature. | true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | docs/scenes/js/material.js | @@ -302,7 +302,6 @@ function guiMaterial( gui, mesh, material, geometry ) {
// folder.add( material, 'polygonOffsetFactor' );
// folder.add( material, 'polygonOffsetUnits' );
folder.add( material, 'alphaTest', 0, 1 );
- // folder.add( material, 'overdraw', 0, 5 );
folder.add( material, 'visible' );
folder.add( material, 'side', constants.side ).onChange( needsUpdate( material, geometry ) );
| true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | examples/misc_lights_test.html | @@ -67,7 +67,7 @@
// Spheres
geometry = new THREE.SphereBufferGeometry( 100, 16, 8 );
- material = new THREE.MeshPhongMaterial( { color: 0xffffff, flatShading: true, overdraw: 0.5, shininess: 0 } );
+ material = new THREE.MeshPhongMaterial( { color: 0xffffff, flatShading: true, shininess: 0 } );
for ( var i = 0; i < 30; i ++ ) {
| true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | examples/misc_ubiquity_test2.html | @@ -56,7 +56,7 @@
texture.wrapT = THREE.RepeatWrapping;
var geometry = new THREE.BoxBufferGeometry( 150, 150, 150, 4, 4, 4 );
- var material = new THREE.MeshBasicMaterial( { map: texture, overdraw: 0.5 } );
+ var material = new THREE.MeshBasicMaterial( { map: texture } );
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh ); | true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | examples/software_geometry_earth.html | @@ -73,7 +73,7 @@
var geometry = new THREE.SphereBufferGeometry( 200, 20, 20 );
- var material = new THREE.MeshLambertMaterial( { map: texture, overdraw: 0.5 } );
+ var material = new THREE.MeshLambertMaterial( { map: texture } );
var mesh = new THREE.Mesh( geometry, material );
group.add( mesh );
@@ -103,7 +103,7 @@
var texture = new THREE.CanvasTexture( canvas );
var geometry = new THREE.PlaneBufferGeometry( 300, 300, 3, 3 );
- var material = new THREE.MeshBasicMaterial( { map: texture, overdraw: 0.5 } );
+ var material = new THREE.MeshBasicMaterial( { map: texture } );
var mesh = new THREE.Mesh( geometry, material );
mesh.position.y = - 250; | true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | examples/software_sandbox.html | @@ -82,7 +82,7 @@
// Cube with texture
var loader = new THREE.TextureLoader();
var map = loader.load( 'textures/brick_diffuse.jpg' );
- texCube = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { map: map, overdraw: 0.5 } ) );
+ texCube = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { map: map } ) );
texCube.position.set( - 300, 0, 0 );
scene.add( texCube );
| true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | examples/webgl_effects_peppersghost.html | @@ -104,7 +104,7 @@
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( colors, 3 ) );
- var material = new THREE.MeshBasicMaterial( { vertexColors: THREE.VertexColors, overdraw: 0.5 } );
+ var material = new THREE.MeshBasicMaterial( { vertexColors: THREE.VertexColors } );
for ( var i = 0; i < 10; i ++ ) {
| true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | src/Three.Legacy.js | @@ -1288,6 +1288,20 @@ Object.defineProperties( Material.prototype, {
}
},
+
+ overdraw: {
+ get: function () {
+
+ console.warn( 'THREE.Material: .overdraw has been removed.' );
+
+ },
+ set: function () {
+
+ console.warn( 'THREE.Material: .overdraw has been removed.' );
+
+ }
+ },
+
wrapRGB: {
get: function () {
| true |
Other | mrdoob | three.js | 8f2439c2d0c71113c8c57096dc1c038260b83520.json | Remove Material.overdraw property | src/materials/Material.js | @@ -59,8 +59,6 @@ function Material() {
this.alphaTest = 0;
this.premultipliedAlpha = false;
- this.overdraw = 0; // Overdrawn pixels (typically between 0 and 1) for fixing antialiasing gaps in CanvasRenderer
-
this.visible = true;
this.userData = {};
@@ -118,11 +116,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
currentValue.copy( newValue );
- } else if ( key === 'overdraw' ) {
-
- // ensure overdraw is backwards-compatible with legacy boolean type
- this[ key ] = Number( newValue );
-
} else {
this[ key ] = newValue;
@@ -349,8 +342,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
this.alphaTest = source.alphaTest;
this.premultipliedAlpha = source.premultipliedAlpha;
- this.overdraw = source.overdraw;
-
this.visible = source.visible;
this.userData = JSON.parse( JSON.stringify( source.userData ) );
| true |
Other | mrdoob | three.js | a99eac6138a368f88c6639b4888d33c5a6c518ce.json | Fix copy and clone methods | src/objects/Line.js | @@ -244,9 +244,20 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
}() ),
+ copy: function ( source ) {
+
+ Object3D.prototype.copy.call( this, source );
+
+ this.geometry.copy( source.geometry );
+ this.material.copy( source.material );
+
+ return this;
+
+ },
+
clone: function () {
- return new this.constructor( this.geometry, this.material ).copy( this );
+ return new this.constructor().copy( this );
}
| false |
Other | mrdoob | three.js | eb9a2e3af01eb013493c951091be0b8a527dbdd7.json | Update stats every frame | examples/misc_controls_trackball.html | @@ -154,14 +154,16 @@
function animate() {
requestAnimationFrame( animate );
+
controls.update();
+
+ stats.update();
}
function render() {
renderer.render( scene, camera );
- stats.update();
}
| false |
Other | mrdoob | three.js | dad0c8d2a7539c98dd70ceded270dd3ec76050aa.json | Fix incorrect body size | examples/misc_controls_trackball.html | @@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
- html {
+ html, body {
width: 100%;
height: 100%;
overflow: hidden; | false |
Other | mrdoob | three.js | b63d0346f526a33cf16e016ed8764b34cf7921f9.json | Fix the overflowing div
The side padding with 100% width causes the div to overflow the screen. So we remove the side padding (no used anyways), and also tell it to use box-sizing: border box to properly calculate the box sizing as expected. | examples/misc_controls_trackball.html | @@ -3,7 +3,7 @@
<head>
<title>three.js webgl - trackball controls</title>
<meta charset="utf-8">
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1">
+ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
html {
width: 100%;
@@ -20,19 +20,14 @@
background-color: #fff;
margin: 0px;
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
}
#info {
color:#000;
position: absolute;
top: 0px; width: 100%;
- padding: 5px;
-
+ padding: 5px 0;
+ box-sizing: border-box;
}
a { | false |
Other | mrdoob | three.js | 08f44d3078771f13e8568ba7dd91f6debe340bad.json | Fix code style to match ESLint requirements. | src/cameras/ArrayCamera.js | @@ -25,10 +25,12 @@ ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototyp
* And that near and far planes are identical for both cameras.
*/
setProjectionFromUnion: function () {
+
var cameraLPos = new Vector3();
var cameraRPos = new Vector3();
return function () {
+
cameraLPos.setFromMatrixPosition( this.cameras[ 0 ].matrixWorld );
cameraRPos.setFromMatrixPosition( this.cameras[ 1 ].matrixWorld );
@@ -54,28 +56,30 @@ ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototyp
// Calculate the new camera's position offset from the
// left camera.
- var zOffset = ipd / (leftFovL + rightFovR);
+ var zOffset = ipd / ( leftFovL + rightFovR );
var xOffset = zOffset * leftFovL;
// TODO: Better way to apply this offset?
this.cameras[ 0 ].matrixWorld.decompose( this.position, this.quaternion, this.scale );
- this.translateX(xOffset);
- this.translateZ(-zOffset);
+ this.translateX( xOffset );
+ this.translateZ( - zOffset );
this.matrixWorld.compose( this.position, this.quaternion, this.scale );
- this.matrixWorldInverse.getInverse(this.matrixWorld);
+ this.matrixWorldInverse.getInverse( this.matrixWorld );
// Find the union of the frustum values of the cameras and scale
// the values so that the near plane's position does not change in world space,
// although must now be relative to the new union camera.
var near2 = near + zOffset;
var far2 = far + zOffset;
var left = leftL - xOffset;
- var right = rightR + (ipd - xOffset)
+ var right = rightR + ( ipd - xOffset );
var top = Math.max( topL, topR );
var bottom = Math.min( bottomL, bottomR );
this.projectionMatrix.makePerspective( left, right, top, bottom, near2, far2 );
- }
+
+ };
+
}(),
} ); | false |
Other | mrdoob | three.js | f2b9480f63052645987c1cca78e7a0b970b49168.json | update logdepthbuf shader | src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl | @@ -1,11 +1,6 @@
-#ifdef USE_LOGDEPTHBUF
+#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
- uniform float logDepthBufFC;
+ uniform float logDepthBufFC;
+ varying float vFragDepth;
- #ifdef USE_LOGDEPTHBUF_EXT
-
- varying float vFragDepth;
-
- #endif
-
-#endif
+#endif
\ No newline at end of file | true |
Other | mrdoob | three.js | f2b9480f63052645987c1cca78e7a0b970b49168.json | update logdepthbuf shader | src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl | @@ -4,8 +4,10 @@
varying float vFragDepth;
- #endif
-
- uniform float logDepthBufFC;
+ #else
+
+ uniform float logDepthBufFC;
+
+ #endif
#endif
\ No newline at end of file | true |
Other | mrdoob | three.js | 5703d81cb7f4faa29d201753c34f9464434fd9ce.json | Remove linter warning | src/extras/Earcut.js | @@ -167,7 +167,7 @@ function earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) {
ear = cureLocalIntersections( ear, triangles, dim );
earcutLinked( ear, triangles, dim, minX, minY, invSize, 2 );
- // as a last resort, try splitting the remaining polygon into two
+ // as a last resort, try splitting the remaining polygon into two
} else if ( pass === 2 ) {
| false |
Other | mrdoob | three.js | 22f2fae48a7b1f393529e2c4257abc0a9a3e08b9.json | get draco version | examples/js/loaders/sea3d/SEA3DDraco.js | @@ -54,13 +54,14 @@ SEA3D.GeometryDraco = function ( name, data, sea3d ) {
var module = SEA3D.GeometryDraco.getModule(),
dracoData = new Int8Array( data.concat( data.position, data.bytesAvailable ).buffer );
+ //data.position += 5; // jump "DRACO" magic string
+ //var version = data.readUByte() + '.' + data.readUByte(); // draco version
+
var decoder = new module.Decoder();
var buffer = new module.DecoderBuffer();
buffer.Init( dracoData, dracoData.length );
-
- var geometryType = decoder.GetEncodedGeometryType( buffer );
-
+
var mesh = new module.Mesh();
var decodingStatus = decoder.DecodeBufferToMesh( buffer, mesh ); | false |
Other | mrdoob | three.js | 5a0fe5c93314a7fbc8cd1cbee9269aaf585da0fb.json | Change varying name | src/renderers/shaders/ShaderChunk/fog_fragment.glsl | @@ -1,6 +1,6 @@
#ifdef USE_FOG
- float fogDepth = length( fogPosition );
+ float fogDepth = length( vFogPosition );
#ifdef FOG_EXP2
| true |
Other | mrdoob | three.js | 5a0fe5c93314a7fbc8cd1cbee9269aaf585da0fb.json | Change varying name | src/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl | @@ -1,7 +1,7 @@
#ifdef USE_FOG
uniform vec3 fogColor;
- varying vec3 fogPosition;
+ varying vec3 vFogPosition;
#ifdef FOG_EXP2
| true |
Other | mrdoob | three.js | 5a0fe5c93314a7fbc8cd1cbee9269aaf585da0fb.json | Change varying name | src/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl | @@ -1,5 +1,5 @@
#ifdef USE_FOG
- varying vec3 fogPosition;
+ varying vec3 vFogPosition;
#endif | true |
Other | mrdoob | three.js | 5a0fe5c93314a7fbc8cd1cbee9269aaf585da0fb.json | Change varying name | src/renderers/shaders/ShaderChunk/fog_vertex.glsl | @@ -1,4 +1,5 @@
-
#ifdef USE_FOG
-fogPosition = mvPosition.xyz;
-#endif
\ No newline at end of file
+
+ vFogPosition = mvPosition.xyz;
+
+#endif | true |
Other | mrdoob | three.js | 44db10ab50c1d6b2f18c97ebb4d08358750b5529.json | Add sizeAttenuation property | docs/api/materials/SpriteMaterial.html | @@ -67,8 +67,11 @@ <h3>[property:Texture map]</h3>
<h3>[property:Radians rotation]</h3>
<p>The rotation of the sprite in radians. Default is 0.</p>
+ <h3>[property:Boolean sizeAttenuation]</h3>
+ <p>Whether the size of the sprite is attenuated by the camera depth. (Perspective camera only.) Default is *true*.</p>
+
<h2>Methods</h2>
- <p>See the base [page:Material] class for common methods.</p>
+ <p>See the base [page:Material] class for common methods.</p>
<h2>Source</h2>
| true |
Other | mrdoob | three.js | 44db10ab50c1d6b2f18c97ebb4d08358750b5529.json | Add sizeAttenuation property | src/materials/SpriteMaterial.js | @@ -6,11 +6,9 @@ import { Color } from '../math/Color.js';
*
* parameters = {
* color: <hex>,
- * opacity: <float>,
* map: new THREE.Texture( <Image> ),
- *
- * uvOffset: new THREE.Vector2(),
- * uvScale: new THREE.Vector2()
+ * rotation: <float>,
+ * sizeAttenuation: <bool>
* }
*/
@@ -25,6 +23,8 @@ function SpriteMaterial( parameters ) {
this.rotation = 0;
+ this.sizeAttenuation = true;
+
this.lights = false;
this.transparent = true;
@@ -45,6 +45,8 @@ SpriteMaterial.prototype.copy = function ( source ) {
this.rotation = source.rotation;
+ this.sizeAttenuation = source.sizeAttenuation;
+
return this;
}; | true |
Other | mrdoob | three.js | 44db10ab50c1d6b2f18c97ebb4d08358750b5529.json | Add sizeAttenuation property | src/renderers/shaders/ShaderLib/sprite_vert.glsl | @@ -11,19 +11,24 @@ void main() {
#include <uv_vertex>
+ vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
+
vec2 scale;
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
+ #ifndef USE_SIZEATTENUATION
+
+ scale *= abs( mvPosition.z );
+
+ #endif
+
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
vec2 rotatedPosition;
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
- vec4 mvPosition;
-
- mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
mvPosition.xy += rotatedPosition;
gl_Position = projectionMatrix * mvPosition; | true |
Other | mrdoob | three.js | 9796f88f0c84dff13ff3723dc7ff3f6da345c610.json | remove unnecessary calculation in Vector3.project | src/math/Vector3.js | @@ -318,7 +318,7 @@ Object.assign( Vector3.prototype, {
return function project( camera ) {
- matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) );
+ matrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
return this.applyMatrix4( matrix );
}; | false |
Other | mrdoob | three.js | d6bbdf590fbb71f0216871b23f5eef3578dd4bdc.json | Remove an extra semicolon from 3D Texture example | examples/webgl_materials_texture_3d.html | @@ -191,7 +191,7 @@
}
- mesh.material.uniforms.depth.value = value;;
+ mesh.material.uniforms.depth.value = value;
}
| false |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/LOD.html | @@ -10,17 +10,15 @@
<body>
[page:Object3D] →
- <h1>[name]</h1>
+ <h1>多细节层次([name],Levels of Detail)</h1>
<p class="desc">
- Level of Detail - show meshes with more or less geometry based on distance from the camera.<br /><br />
-
- Every level is associated with an object, and rendering can be switched between them at the distances
- specified. Typically you would create, say, three meshes, one for far away (low detail), one for mid range (medium detail)
- and one for close up (high detail).
+ 多细节层次 —— 在显示网格时,根据摄像机距离物体的距离,来使用更多或者更少的几何体来对其进行显示。<br /><br />
+ 每一个级别都和一个几何体相关联,且在渲染时,可以根据给定的距离,来在这些级别对应的几何体之间进行切换。
+ 通常情况下,你会创建多个几何体,比如说三个,一个距离很远(低细节),一个距离不近不远,大概在中间(中等细节),还有一个距离非常近(高质量)。
</p>
- <h2>Example</h2>
+ <h2>示例</h2>
<p>
[example:webgl_lod webgl / lod ]
@@ -44,76 +42,72 @@ <h2>Example</h2>
</code>
<p>
- Note that for the LOD to switch between the different detail levels, you will
- have to call [page:.update update]( camera ) in your render loop. See the source code
- for this example for details:
+ 请注意,要使得LOD在各不同细节层次之间进行切换,你将需要在你的渲染循环中调用[page:.update update]( camera )。
+ 详情请查看这个示例中的源代码:
[example:webgl_lod WebGL / LOD]
</div>
<h2>Constructor</h2>
<h3>[name]( )</h3>
<p>
- Creates a new [name].
+ 创建一个新的 [name].
</p>
- <h2>Properties</h2>
- <p>See the base [page:Object3D] class for common properties.</p>
+ <h2>属性</h2>
+ <p>请参阅其基类[page:Object3D]来查看公共属性。</p>
<h3>[property:array levels]</h3>
<p>
- An array of [page:object level] objects<br /><br />
+ 一个包含有[page:object level] objects(各层次物体)的数组。<br /><br />
- Each level is an object with two properties:<br />
- [page:Object3D object] - The [page:Object3D] to display at this level.<br />
- [page:Float distance] - The distance at which to display this level of detail.
+ 每一个层级都是一个对象,具有以下两个属性:
+ [page:Object3D object] —— 在这个层次中将要显示的[page:Object3D]。<br />
+ [page:Float distance] —— 将显示这一细节层次的距离。
</p>
- <h2>Methods</h2>
- <p>See the base [page:Object3D] class for common methods.</p>
+ <h2>方法</h2>
+ <p>请参阅其基类[page:Object3D]来查看共有方法。</p>
<h3>[method:null addLevel]( [param:Object3D object], [param:Float distance] )</h3>
<p>
- [page:Object3D object] - The [page:Object3D] to display at this level.<br />
- [page:Float distance] - The distance at which to display this level of detail.<br /><br />
+ [page:Object3D object] —— 在这个层次中将要显示的[page:Object3D]。<br />
+ [page:Float distance] —— 将显示这一细节层次的距离。<br /><br />
- Adds a mesh that will display at a certain distance and greater. Typically the further away the distance,
- the lower the detail on the mesh.
+ 添加在一定距离和更大范围内显示的网格。通常来说,距离越远,网格中的细节就越少。
</p>
<h3>[method:LOD clone]()</h3>
<p>
- Returns a clone of this LOD object and its associated distance specific objects.
+ 返回一个LOD对象及其所关联的在特定距离中的物体。
</p>
<h3>[method:Object3D getObjectForDistance]( [param:Float distance] )</h3>
<p>
- Get a reference to the first [page:Object3D] (mesh) that is greater than [page:Float distance].
+ 获得第一个比[page:Float distance]大的[page:Object3D](网格)的引用。
</p>
<h3>[method:Array raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
<p>
- Get intersections between a casted [page:Ray] and this LOD.
- [page:Raycaster.intersectObject] will call this method.
+ 在一条投射出去的[page:Ray](射线)和这个LOD之间获得交互。
+ [page:Raycaster.intersectObject]将会调用这个方法。
</p>
<h3>[method:null toJSON]( meta )</h3>
<p>
- Create a JSON structure with details of this LOD object.
+ 使用这个方法,为LOD对象中的每个细节层次创建一个JSON结构。
</p>
<h3>[method:null update]( [param:Camera camera] )</h3>
<p>
- Set the visibility of each [page:levels level]'s [page:Object3D object] based on
- distance from the [page:Camera camera]. This needs to be called in the render loop
- for levels of detail to be updated dynamically.
+ 基于每个[page:levels level]中的[page:Object3D object]和[page:Camera camera](摄像机)之间的距离,来设置其可见性。
+ 为了使得多细节层次能够被自动地更新,这个方法需要在渲染循环中被调用。
</p>
- <h2>Source</h2>
-
+ <h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html> | true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/Line.html | @@ -10,20 +10,17 @@
<body>
[page:Object3D] →
- <h1>[name]</h1>
+ <h1>线([name])</h1>
<p class="desc">
- A continuous line.<br /><br />
-
- This is nearly the same
- as [page:LineSegments]; the only difference is that it is rendered using
- [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]
- instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]
+ 一条连续的线。<br /><br />
+ 它几乎和[page:LineSegments]是一样的,唯一的区别是它在渲染时使用的是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP],
+ 而不是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]。
</p>
- <h2>Example</h2>
+ <h2>示例</h2>
<code>var material = new THREE.LineBasicMaterial({
color: 0x0000ff
@@ -41,57 +38,59 @@ <h2>Example</h2>
</code>
- <h2>Constructor</h2>
+ <h2>构造器</h2>
<h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
<p>
- [page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:BufferGeometry].<br />
- [page:Material material] — material for the line. Default is a new [page:LineBasicMaterial] with random color.<br />
+ [page:Geometry geometry] —— 表示线段的顶点,默认值是一个新的[page:BufferGeometry]。<br />
+ [page:Material material] —— 线的材质,默认值是一个新的具有随机颜色的[page:LineBasicMaterial]。<br />
</p>
- <p>If no material is supplied, a randomized line material will be created and assigned to the object.</p>
+ <p>如果没有指定材质,一个随机颜色的线的材质将会被创建,并应用到该物体上。</p>
- <h2>Properties</h2>
- <p>See the base [page:Object3D] class for common properties.</p>
+ <h2>属性</h2>
+ <p>请参阅其基类 [page:Object3D] 来查看共有属性。</p>
<h3>[property:Boolean isLine]</h3>
<p>
- Used to check whether this or derived classes are lines. Default is *true*.<br /><br />
-
- You should not change this, as it used internally for optimisation.
+ 用于检查这个类或者其派生类是否为线,默认值为*true*。
+
+ <br /><br />
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
</p>
<h3>[property:Geometry geometry]</h3>
- <p>Vertices representing the line segment(s).</p>
+ <p>表示线段的顶点。</p>
<h3>[property:Material material]</h3>
- <p>Material for the line.</p>
+ <p>线的材质。</p>
- <h2>Methods</h2>
- <p>See the base [page:Object3D] class for common methods.</p>
+ <h2>方法</h2>
+ <p>请参阅其基类 [page:Object3D] 来查看共有方法。</p>
<h3>[method:Line computeLineDistances]()</h3>
<p>
- Computes an array of distance values which are necessary for [page:LineDashedMaterial]. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
+ 计算[page:LineDashedMaterial]所需的距离的值的数组。
+ 对于几何体中的每一个顶点,这个方法计算出了当前点到线的起始点的累积长度。
</p>
<h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
<p>
- Get intersections between a casted [page:Ray] and this Line.
- [page:Raycaster.intersectObject] will call this method.
+ 在一条投射出去的[page:Ray](射线)和这条线之间产生交互。
+ [page:Raycaster.intersectObject]将会调用这个方法。
</p>
<h3>[method:Line clone]()</h3>
<p>
- Returns a clone of this Line object and its descendants.
+ 返回这条线及其子集的一个克隆对象。
</p>
- <h2>Source</h2>
+ <h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body> | true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/LineLoop.html | @@ -10,45 +10,43 @@
<body>
[page:Object3D] → [page:Line] →
- <h1>[name]</h1>
+ <h1>环线([name])</h1>
<p class="desc">
- A continuous line that connects back to the start.<br /><br />
-
- This is nearly the same as [page:Line]; the only difference is that it is rendered using
- [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_LOOP]
- instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP],
- which draws a straight line to the next vertex, and connects the last vertex back to the first.
+ 一条头尾相接的连续的线。<br /><br />
+ 它几乎和[page:Line]是相同的,唯一的区别是它在渲染时使用的是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_LOOP],
+ 而不是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP],
+ 它绘制一条直线到下一个顶点,并将最后一个顶点连回第一个顶点。
</p>
- <h2>Constructor</h2>
+ <h2>构造器</h2>
<h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
<p>
- [page:Geometry geometry] — List of vertices representing points on the line loop.<br />
- [page:Material material] — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].
+ [page:Geometry geometry] —— 表示环线上的点的顶点列表。<br />
+ [page:Material material] —— 线的材质,默认值是[page:LineBasicMaterial LineBasicMaterial]。
</p>
- <p>If no material is supplied, a randomized line material will be created and assigned to the object.</p>
+ <p>如果没有指定材质,一个随机颜色的线的材质将会被创建,并应用到该物体上。</p>
- <h2>Properties</h2>
- <p>See the base [page:Line] class for common properties.</p>
+ <h2>属性</h2>
+ <p>请参阅其基类 [page:Line] 来查看共有属性。</p>
<h3>[property:Boolean isLineLoop]</h3>
<p>
- Used to check whether this or derived classes are line loops. Default is *true*.<br /><br />
-
- You should not change this, as it used internally for optimisation.
+ 用于检查这个类或者其派生类是否为环线,默认值为*true*。<br /><br />
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
</p>
- <h2>Methods</h2>
- <p>See the base [page:Line] class for common methods.</p>
+ <h2>方法</h2>
+ <p>
+ 请查看其基类[page:Line]来查看共有方法。</p>
- <h2>Source</h2>
+ <h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body> | true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/LineSegments.html | @@ -10,44 +10,41 @@
<body>
[page:Object3D] → [page:Line] →
- <h1>[name]</h1>
+ <h1>线段([name])</h1>
<p class="desc">
- A series of lines drawn between pairs of vertices.<br /><br />
-
- This is nearly the same as [page:Line]; the only difference is that it is rendered using
- [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES]
- instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP].
+ 在若干对的顶点之间绘制的一系列的线。<br /><br />
+ 它和[page:Line]几乎是相同的,唯一的区别是它在渲染时使用的是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINES],
+ 而不是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.LINE_STRIP]。
</p>
- <h2>Constructor</h2>
+ <h2>构造器</h2>
<h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
<p>
- [page:Geometry geometry] — Pair(s) of vertices representing each line segment(s).<br />
- [page:Material material] — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].
+ [page:Geometry geometry] —— 表示每条线段的两个顶点。<br />
+ [page:Material material] —— 线的材质,默认值是[page:LineBasicMaterial LineBasicMaterial]。
</p>
- <p>If no material is supplied, a randomized line material will be created and assigned to the object.</p>
+ <p>如果没有指定材质,一个随机颜色的线的材质将会被创建,并应用到该物体上。</p>
- <h2>Properties</h2>
- <p>See the base [page:Line] class for common properties.</p>
+ <h2>属性</h2>
+ <p>请参阅其基类[page:Line]来查看共有属性。</p>
<h3>[property:Boolean isLineSegments]</h3>
<p>
- Used to check whether this or derived classes are line segments. Default is *true*.<br /><br />
-
- You should not change this, as it used internally for optimisation.
+ 用于检查这个类或者其派生类是否为线段,默认值为*true*。
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
</p>
- <h2>Methods</h2>
- <p>See the base [page:Line] class for common methods.</p>
+ <h2>方法</h2>
+ <p>请参阅其基类[page:Line]来查看共有属性。</p>
- <h2>Source</h2>
+ <h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body> | true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/Mesh.html | @@ -10,15 +10,15 @@
<body>
[page:Object3D] →
- <h1>[name]</h1>
+ <h1>网格([name])</h1>
<p class="desc">
- Class representing triangular [link:https://en.wikipedia.org/wiki/Polygon_mesh polygon mesh] based objects.
- Also serves as a base for other classes such as [page:SkinnedMesh].
+ 表示基于以三角形为[link:https://en.wikipedia.org/wiki/Polygon_mesh polygon mesh](多边形网格)的物体的类。
+ 同时也作为其他类的基类,例如[page:SkinnedMesh]。
</p>
- <h2>Example</h2>
+ <h2>示例</h2>
<code>
var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 );
@@ -28,85 +28,80 @@ <h2>Example</h2>
</code>
- <h2>Constructor</h2>
+ <h2>构造器</h2>
<h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
<p>
- [page:Geometry geometry] — (optional) an instance of [page:Geometry] or [page:BufferGeometry].
- Default is a new [page:BufferGeometry].<br />
- [page:Material material] — (optional) a single or an array of [page:Material]. Default is a new [page:MeshBasicMaterial]
+ [page:Geometry geometry] —— (可选)[page:Geometry]或者[page:BufferGeometry]的实例,默认值是一个新的[page:BufferGeometry]。<br />
+ [page:Material material] —— (可选)一个[page:Material],或是一个包含有[page:Material]的数组,默认是一个新的[page:MeshBasicMaterial]。
</p>
- <h2>Properties</h2>
- <p>See the base [page:Object3D] class for common properties.</p>
+ <h2>属性</h2>
+ <p>请参阅其基类[page:Object3D]来查看共有属性。</p>
<h3>[property:Integer drawMode]</h3>
<p>
- Determines how the mesh triangles are constructed from the vertices.
- See the draw mode [page:DrawModes constants] for all possible values.
- Default is [page:DrawModes TrianglesDrawMode].
+ 决定了网格中的三角形将如何从顶点来构造。
+ 请参阅draw mode [page:DrawModes constants](绘图模式常量)来查看其所有可能的值。
+ 其默认值是[page:DrawModes TrianglesDrawMode]。
</p>
<h3>[property:Boolean isMesh]</h3>
<p>
- Used to check whether this or derived classes are meshes. Default is *true*.<br /><br />
-
- You should not change this, as it is used internally for optimisation.
+ 用于检查这个类或者其派生类是否为网格,默认值为*true*。<br /><br />
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
</p>
<h3>[property:Geometry geometry]</h3>
<p>
- An instance of [page:Geometry] or [page:BufferGeometry] (or derived classes),
- defining the object's structure.<br /><br />
+ [page:Geometry] 或 [page:BufferGeometry] 的实例或者派生类,定义了物体的结构。<br /><br />
- It's recommended to always use a [page:BufferGeometry] if possible for best performance.
+ 如有可能,推荐总是使用[page:BufferGeometry]来获得最好的表现。
</p>
<h3>[property:Material material]</h3>
<p>
- An instance of material derived from the [page:Material] base class or an array of materials, defining the
- object's appearance. Default is a [page:MeshBasicMaterial] with a random color.
+ 由[page:Material]基类或者一个包含材质的数组派生而来的材质实例,定义了物体的外观。默认值是一个具有随机颜色的[page:MeshBasicMaterial]。
</p>
<h3>[property:Array morphTargetInfluences]</h3>
<p>
- An array of weights typically from 0-1 that specify how much of the morph is applied.
- Undefined by default, but reset to a blank array by [page:Mesh.updateMorphTargets updateMorphTargets].
+ 一个包含有权重(值一般在0-1范围内)的数组,指定应用了多少变形。
+ 默认情况下是未定义的,但是会被[page:Mesh.updateMorphTargets updateMorphTargets]重置为一个空数组。
</p>
<h3>[property:Object morphTargetDictionary]</h3>
<p>
- A dictionary of morphTargets based on the morphTarget.name property.
- Undefined by default, but rebuilt [page:Mesh.updateMorphTargets updateMorphTargets].
+ 基于morphTarget.name属性的morphTargets字典。
+ 默认情况下是未定义的,但是会被[page:Mesh.updateMorphTargets updateMorphTargets]重建。
</p>
- <h2>Methods</h2>
- <p>See the base [page:Object3D] class for common methods.</p>
+ <h2>方法</h2>
+ <p>请参阅其基类[page:Object3D]来查看共有方法。</p>
<h3>[method:null setDrawMode]( [param:Integer value] )</h3>
- <p>Set the value of [page:.drawMode drawMode].</p>
+ <p>设置[page:.drawMode drawMode]的值。</p>
<h3>[method:Mesh clone]()</h3>
- <p>Returns a clone of this [name] object and its descendants.</p>
+ <p>返回这个[name]对象及其子级的克隆。</p>
<h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
<p>
- Get intersections between a casted ray and this mesh.
- [page:Raycaster.intersectObject] will call this method.
+ 在一条投射出去的[page:Ray](射线)和这个网格之间产生交互。
+ [page:Raycaster.intersectObject]将会调用这个方法。
</p>
<h3>[method:null updateMorphTargets]()</h3>
<p>
- Updates the morphTargets to have no influence on the object. Resets the
- [page:Mesh.morphTargetInfluences morphTargetInfluences] and
- [page:Mesh.morphTargetDictionary morphTargetDictionary] properties.
+ 更新morphTargets,使其不对对象产生影响,重置[page:Mesh.morphTargetInfluences morphTargetInfluences] and
+ [page:Mesh.morphTargetDictionary morphTargetDictionary]属性。
</p>
- <h2>Source</h2>
+ <h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body> | true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/Points.html | @@ -1,78 +1,75 @@
<!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>
+<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>
- <p class="desc">
- A class for displaying points.
- The points are rendered by the [page:WebGLRenderer] using
- [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.POINTS].
- </p>
+<body>
+ [page:Object3D] →
+ <h1>点([name])</h1>
- <h2>Constructor</h2>
+ <p class="desc">
+ 一个用于显示点的类。
+ 由[page:WebGLRenderer]渲染的点使用
+ [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements gl.POINTS]。
+ </p>
- <h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
- <p>
- [page:Geometry geometry] — (optional) an instance of [page:Geometry] or [page:BufferGeometry].
- Default is a new [page:BufferGeometry].<br />
- [page:Material material] — (optional) a [page:Material]. Default is a new [page:PointsMaterial]
- with a random color.
- </p>
+ <h2>构造器</h2>
- <h2>Properties</h2>
- <p>See the base [page:Object3D] class for common properties.</p>
+ <h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
+ <p>
+ [page:Geometry geometry] —— (可选)是一个[page:Geometry]或者[page:BufferGeometry]的实例,默认值是一个新的[page:BufferGeometry]。
+ <br />
+ [page:Material material] —— (可选) 是一个对象,默认值是一个具有随机颜色的新的[page:PointsMaterial]。
+ </p>
- <h3>[property:Geometry geometry]</h3>
- <p>
- An instance of [page:Geometry] or [page:BufferGeometry] (or derived classes),
- defining the object's structure.<br /><br />
- Its recommended to always use a [page:BufferGeometry] if possible for best performance.
- </p>
+ <h2>属性</h2>
+ <p>请参阅其基类[page:Object3D]来查看共有属性。</p>
- <h3>[property:Boolean isPoints]</h3>
- <p>
- Used to check whether this or derived classes are points. Default is *true*.<br /><br />
+ <h3>[property:Geometry geometry]</h3>
+ <p>
+ 一个[page:Geometry]或[page:BufferGeometry]的实例(或者派生类),定义了物体的结构。<br /><br />
+ 如有可能,推荐总是使用[page:BufferGeometry]来获得最佳表现。
+ </p>
- You should not change this, as it used internally for optimisation.
- </p>
+ <h3>[property:Boolean isPoints]</h3>
+ <p>用于检查这个类或者其派生类是否为点,默认值为*true*。<br /><br />
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
+ </p>
- <h3>[property:Material material]</h3>
- <p>
- An instance of [page:Material], defining the object's appearance.
- Default is a [page:PointsMaterial] with a random color.
- </p>
+ <h3>[property:Material material]</h3>
+ <p>
+ [page:Material]的实例。定义了物体的外观。默认值是一个具有随机颜色的[page:PointsMaterial]。
+ </p>
- <h2>Methods</h2>
- <p>See the base [page:Object3D] class for common methods.</p>
+ <h2>方法</h2>
+ <p>请参阅其基类[page:Object3D]来查看共有方法。</p>
- <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
- <p>
- Get intersections between a casted ray and this Points.
- [page:Raycaster.intersectObject] will call this method.
- </p>
+ <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
+ <p>
+ 在一条投射出去的[page:Ray](射线)和点之间产生交互。
+ [page:Raycaster.intersectObject]将会调用这个方法。
+ </p>
- <h3>[method:Points clone]()</h3>
- <p>
- Returns a clone of this Points object and its descendants.
- </p>
+ <h3>[method:Points clone]()</h3>
+ <p>
+ 返回这个点及其子集的一个克隆对象。
+ </p>
- <h2>Source</h2>
+ <h2>源代码</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
-</html>
+</body>
+
+</html>
\ No newline at end of file | true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/Skeleton.html | @@ -103,7 +103,7 @@ <h3>[method:null update]()</h3>
<h3>[method:Bone getBoneByName]( [param:String name] )</h3>
<p>
- name -- 匹配Bone对象中.name属性的字符串。<br /><br />
+ name —— 匹配Bone对象中.name属性的字符串。<br /><br />
在骨架中的骨骼数组中遍览,并返回第一个能够和name匹配上的骨骼对象。<br />
</p>
| true |
Other | mrdoob | three.js | 9ee9259ed3db6a179ee9ba041e701d15991044c4.json | Finish the translation in the objects. | docs/api/zh/objects/Sprite.html | @@ -43,7 +43,7 @@ <h2>属性</h2>
<h3>[property:Boolean isSprite]</h3>
<p>
用于检查这个类或者其派生类是否为精灵,默认值为*true*。<br /><br />
- 你不应当对这个属性进行改变,因为它在使用,以用于优化。
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
</p>
| true |
Other | mrdoob | three.js | a6c3193465f533048d1608fbce30d3bbaf9e5d74.json | Translate some page in the object,and little fix. | docs/api/zh/cameras/Camera.html | @@ -34,7 +34,7 @@ <h3>[property:Boolean isCamera]</h3>
用于来检查这个类或者派生的类是否为摄像机,默认为*true*。
<br /><br />
- 你不应当对这个属性进行改变,因为它在内部由渲染器使用,以用于优化。
+ 你不应当对这个属性进行改变,因为它在内部由渲染器使用,以用于优化。
</p>
<h3>[property:Layers layers]</h3> | true |
Other | mrdoob | three.js | a6c3193465f533048d1608fbce30d3bbaf9e5d74.json | Translate some page in the object,and little fix. | docs/api/zh/objects/Bone.html | @@ -10,14 +10,14 @@
<body>
[page:Object3D] →
- <h1>[name]</h1>
+ <h1>骨骼([name])</h1>
<p class="desc">
- A bone which is part of a [page:Skeleton]. The skeleton in turn is used by the [page:SkinnedMesh].
- Bones are almost identical to a blank [page:Object3D].
+ 骨骼是[page:Skeleton](骨架)的一部分。骨架是由[page:SkinnedMesh](蒙皮网格)依次来使用的。
+ 骨骼几乎和空白[page:Object3D]相同。
</p>
- <h3>Example</h3>
+ <h3>示例</h3>
<code>
var root = new THREE.Bone();
@@ -27,32 +27,31 @@ <h3>Example</h3>
child.position.y = 5;
</code>
- <h2>Constructor</h2>
+ <h2>构造器</h2>
<h3>[name]( )</h3>
<p>
- Creates a new [name].
+ 创建一个新的[name].
</p>
- <h2>Properties</h2>
- <p>See the base [page:Object3D] class for common properties.</p>
+ <h2>属性</h2>
+ <p>请参阅其基类[page:Object3D]来查看共有属性。</p>
<h3>[property:Boolean isBone]</h3>
<p>
- Used to check whether this or derived classes are bones. Default is *true*.<br /><br />
-
- You should not change this, as it used internally for optimisation.
+ 用于检查这个类或其派生类是否为骨骼。默认值为*true*。<br /><br />
+ 你不应当对这个属性进行改变,因为它在内部使用,以用于优化。
</p>
<h3>[property:String type]</h3>
- <p>Set to 'Bone', this can be used to find all Bones in a scene.</p>
+ <p>设置为“Bone”,这可以用于在一个场景中找到所有的Bones。</p>
- <h2>Methods</h2>
- <p>See the base [page:Object3D] class for common methods.</p>
+ <h2>方法</h2>
+ <p>请参阅其基类[page:Object3D]来查看其共有方法。</p>
- <h2>Source</h2>
+ <h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body> | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.