diff --git a/manual/en/backgrounds.html b/manual/en/backgrounds.html index 5dbbcc34f49386..da1eb87d2983f7 100644 --- a/manual/en/backgrounds.html +++ b/manual/en/backgrounds.html @@ -73,6 +73,7 @@

Backgrounds and Skyboxes

a texture.

const loader = new THREE.TextureLoader();
 const bgTexture = loader.load('resources/images/daikanyama.jpg');
+bgTexture.colorSpace = THREE.SRGBColorSpace;
 scene.background = bgTexture;
 

which gives us

@@ -219,11 +220,6 @@

Backgrounds and Skyboxes

this site.

-

It's not much different. First we load the equirectangular image as a texture -and then, in the callback after it has loaded, we can call WebGLCubeRenderTarget.fromEquirectangularTexture -which will generate a cubemap from the equirectangular texture for us. -We pass in the size we want the cubemap to be to WebGLCubeRenderTarget. -Passing in the height of the equirectangular image seems like a good bet.

{
 -  const loader = new THREE.CubeTextureLoader();
 -  const texture = loader.load([
@@ -239,9 +235,9 @@ 

Backgrounds and Skyboxes

+ const texture = loader.load( + 'resources/images/equirectangularmaps/tears_of_steel_bridge_2k.jpg', + () => { -+ const rt = new THREE.WebGLCubeRenderTarget(texture.image.height); -+ rt.fromEquirectangularTexture(renderer, texture); -+ scene.background = rt.texture; ++ texture.mapping = THREE.EquirectangularReflectionMapping; ++ texture.colorSpace = THREE.SRGBColorSpace; ++ scene.background = texture; + }); }
diff --git a/manual/en/custom-buffergeometry.html b/manual/en/custom-buffergeometry.html index b2db696c9f59c2..98e98d162fbb3d 100644 --- a/manual/en/custom-buffergeometry.html +++ b/manual/en/custom-buffergeometry.html @@ -436,8 +436,7 @@

Custom BufferGeometry

make your own geometry and how to dynamically update the contents of a BufferAttribute.

-

-

+

diff --git a/manual/en/fundamentals.html b/manual/en/fundamentals.html index 749d1530c9021d..7f02afad43d3b2 100644 --- a/manual/en/fundamentals.html +++ b/manual/en/fundamentals.html @@ -273,7 +273,7 @@

Fundamentals

three.js which we'll go over in a future article. For now let's create a directional light.

{
   const color = 0xFFFFFF;
-  const intensity = 1;
+  const intensity = 3;
   const light = new THREE.DirectionalLight(color, intensity);
   light.position.set(-1, 2, 4);
   scene.add(light);
diff --git a/manual/examples/3dlut-base-cube-maker.html b/manual/examples/3dlut-base-cube-maker.html
index f3aecd6438c771..5137a7b8c88948 100644
--- a/manual/examples/3dlut-base-cube-maker.html
+++ b/manual/examples/3dlut-base-cube-maker.html
@@ -26,63 +26,88 @@ 

Color Cube Image Maker

diff --git a/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html b/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html index 3851074e776da6..fbe22ea1be1803 100644 --- a/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html +++ b/manual/examples/align-html-elements-to-3d-globe-too-many-labels.html @@ -73,151 +73,184 @@ - - - - - - diff --git a/manual/examples/custom-geometry-cube-face-normals.html b/manual/examples/custom-geometry-cube-face-normals.html deleted file mode 100644 index d56d6b82ba5f4d..00000000000000 --- a/manual/examples/custom-geometry-cube-face-normals.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - face normals - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube-texcoords.html b/manual/examples/custom-geometry-cube-texcoords.html deleted file mode 100644 index 7340127487c95d..00000000000000 --- a/manual/examples/custom-geometry-cube-texcoords.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - Texture Coordinates - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube-vertex-colors.html b/manual/examples/custom-geometry-cube-vertex-colors.html deleted file mode 100644 index 447d6123bfdc10..00000000000000 --- a/manual/examples/custom-geometry-cube-vertex-colors.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - Vertex Colors - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube-vertex-normals.html b/manual/examples/custom-geometry-cube-vertex-normals.html deleted file mode 100644 index 422fe5a9233bc5..00000000000000 --- a/manual/examples/custom-geometry-cube-vertex-normals.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - Vertex Normals - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-cube.html b/manual/examples/custom-geometry-cube.html deleted file mode 100644 index 7ea446946a2861..00000000000000 --- a/manual/examples/custom-geometry-cube.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Cube - - - - - - - - - - - - - - diff --git a/manual/examples/custom-geometry-heightmap.html b/manual/examples/custom-geometry-heightmap.html deleted file mode 100644 index 69a80d4fb3cdf6..00000000000000 --- a/manual/examples/custom-geometry-heightmap.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - Three.js - Custom Geometry - Heightmap - - - - - - - - - - - - - - diff --git a/manual/examples/debug-js-clearing-logger.html b/manual/examples/debug-js-clearing-logger.html index ba5affee7765d4..85ad6a7826d0e4 100644 --- a/manual/examples/debug-js-clearing-logger.html +++ b/manual/examples/debug-js-clearing-logger.html @@ -49,110 +49,143 @@ import * as THREE from 'three'; class ClearingLogger { - constructor(elem) { - this.elem = elem; - this.lines = []; - } - log(...args) { - this.lines.push([...args].join(' ')); - } - render() { - this.elem.textContent = this.lines.join('\n'); - this.lines = []; - } + + constructor( elem ) { + + this.elem = elem; + this.lines = []; + + } + log( ...args ) { + + this.lines.push( [ ...args ].join( ' ' ) ); + + } + render() { + + this.elem.textContent = this.lines.join( '\n' ); + this.lines = []; + + } + } function main() { - const canvas = document.querySelector('#c'); - const renderer = new THREE.WebGLRenderer({antialias: true, canvas}); - const fov = 75; - const aspect = 2; // the canvas default - const near = 0.1; - const far = 50; - const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); - camera.position.z = 20; + const canvas = document.querySelector( '#c' ); + const renderer = new THREE.WebGLRenderer( { antialias: true, canvas } ); + renderer.useLegacyLights = false; - const scene = new THREE.Scene(); - scene.background = new THREE.Color('cyan'); + const fov = 75; + const aspect = 2; // the canvas default + const near = 0.1; + const far = 50; + const camera = new THREE.PerspectiveCamera( fov, aspect, near, far ); + camera.position.z = 20; - const geometry = new THREE.SphereGeometry(); - const material = new THREE.MeshBasicMaterial({color: 'red'}); + const scene = new THREE.Scene(); + scene.background = new THREE.Color( 'cyan' ); - const things = []; + const geometry = new THREE.SphereGeometry(); + const material = new THREE.MeshBasicMaterial( { color: 'red' } ); - function rand(min, max) { - if (max === undefined) { - max = min; - min = 0; - } - return Math.random() * (max - min) + min; - } + const things = []; - function createThing() { - const mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); - things.push({ - mesh, - timer: 2, - velocity: new THREE.Vector3(rand(-5, 5), rand(-5, 5), rand(-5, 5)), - }); - } + function rand( min, max ) { - canvas.addEventListener('click', createThing); + if ( max === undefined ) { - function resizeRendererToDisplaySize(renderer) { - const canvas = renderer.domElement; - const width = canvas.clientWidth; - const height = canvas.clientHeight; - const needResize = canvas.width !== width || canvas.height !== height; - if (needResize) { - renderer.setSize(width, height, false); - } - return needResize; - } + max = min; + min = 0; - const logger = new ClearingLogger(document.querySelector('#debug pre')); + } - let then = 0; - function render(now) { - now *= 0.001; // convert to seconds - const deltaTime = now - then; - then = now; + return Math.random() * ( max - min ) + min; - if (resizeRendererToDisplaySize(renderer)) { - const canvas = renderer.domElement; - camera.aspect = canvas.clientWidth / canvas.clientHeight; - camera.updateProjectionMatrix(); - } + } - logger.log('fps:', (1 / deltaTime).toFixed(1)); - logger.log('num things:', things.length); - for (let i = 0; i < things.length;) { - const thing = things[i]; - const mesh = thing.mesh; - const pos = mesh.position; - logger.log( - 'timer:', thing.timer.toFixed(3), - 'pos:', pos.x.toFixed(3), pos.y.toFixed(3), pos.z.toFixed(3)); - thing.timer -= deltaTime; - if (thing.timer <= 0) { - // remove this thing. Note we don't advance `i` - things.splice(i, 1); - scene.remove(mesh); - } else { - mesh.position.addScaledVector(thing.velocity, deltaTime); - ++i; - } - } + function createThing() { - renderer.render(scene, camera); - logger.render(); + const mesh = new THREE.Mesh( geometry, material ); + scene.add( mesh ); + things.push( { + mesh, + timer: 2, + velocity: new THREE.Vector3( rand( - 5, 5 ), rand( - 5, 5 ), rand( - 5, 5 ) ), + } ); - requestAnimationFrame(render); - } + } + + canvas.addEventListener( 'click', createThing ); + + function resizeRendererToDisplaySize( renderer ) { + + const canvas = renderer.domElement; + const width = canvas.clientWidth; + const height = canvas.clientHeight; + const needResize = canvas.width !== width || canvas.height !== height; + if ( needResize ) { + + renderer.setSize( width, height, false ); + + } + + return needResize; + + } + + const logger = new ClearingLogger( document.querySelector( '#debug pre' ) ); + + let then = 0; + function render( now ) { + + now *= 0.001; // convert to seconds + const deltaTime = now - then; + then = now; + + if ( resizeRendererToDisplaySize( renderer ) ) { + + const canvas = renderer.domElement; + camera.aspect = canvas.clientWidth / canvas.clientHeight; + camera.updateProjectionMatrix(); + + } + + logger.log( 'fps:', ( 1 / deltaTime ).toFixed( 1 ) ); + logger.log( 'num things:', things.length ); + for ( let i = 0; i < things.length; ) { + + const thing = things[ i ]; + const mesh = thing.mesh; + const pos = mesh.position; + logger.log( + 'timer:', thing.timer.toFixed( 3 ), + 'pos:', pos.x.toFixed( 3 ), pos.y.toFixed( 3 ), pos.z.toFixed( 3 ) ); + thing.timer -= deltaTime; + if ( thing.timer <= 0 ) { + + // remove this thing. Note we don't advance `i` + things.splice( i, 1 ); + scene.remove( mesh ); + + } else { + + mesh.position.addScaledVector( thing.velocity, deltaTime ); + ++ i; + + } + + } + + renderer.render( scene, camera ); + logger.render(); + + requestAnimationFrame( render ); + + } + + requestAnimationFrame( render ); - requestAnimationFrame(render); } main(); diff --git a/manual/examples/debug-js-html-elements.html b/manual/examples/debug-js-html-elements.html index 57189edec93968..903235489b09a3 100644 --- a/manual/examples/debug-js-html-elements.html +++ b/manual/examples/debug-js-html-elements.html @@ -50,64 +50,76 @@ import * as THREE from 'three'; function main() { - const canvas = document.querySelector('#c'); - const renderer = new THREE.WebGLRenderer({antialias: true, canvas}); - - const fov = 75; - const aspect = 2; // the canvas default - const near = 0.1; - const far = 50; - const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); - camera.position.z = 20; - - const scene = new THREE.Scene(); - scene.background = new THREE.Color('red'); - - const geometry = new THREE.SphereGeometry(); - const material = new THREE.MeshBasicMaterial({color: 'yellow'}); - - const mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); - - function resizeRendererToDisplaySize(renderer) { - const canvas = renderer.domElement; - const width = canvas.clientWidth; - const height = canvas.clientHeight; - const needResize = canvas.width !== width || canvas.height !== height; - if (needResize) { - renderer.setSize(width, height, false); - } - return needResize; - } - const xElem = document.querySelector('#x'); - const yElem = document.querySelector('#y'); - const zElem = document.querySelector('#z'); + const canvas = document.querySelector( '#c' ); + const renderer = new THREE.WebGLRenderer( { antialias: true, canvas } ); + renderer.useLegacyLights = false; - function render(time) { - time *= 0.001; // convert to seconds + const fov = 75; + const aspect = 2; // the canvas default + const near = 0.1; + const far = 50; + const camera = new THREE.PerspectiveCamera( fov, aspect, near, far ); + camera.position.z = 20; - if (resizeRendererToDisplaySize(renderer)) { - const canvas = renderer.domElement; - camera.aspect = canvas.clientWidth / canvas.clientHeight; - camera.updateProjectionMatrix(); - } + const scene = new THREE.Scene(); + scene.background = new THREE.Color( 'red' ); - mesh.position.set( - Math.sin(time * 1.2) * 5, - Math.sin(time * 1.1) * 5, - Math.sin(time * 1.3) * 10, - ); - xElem.textContent = mesh.position.x.toFixed(3); - yElem.textContent = mesh.position.y.toFixed(3); - zElem.textContent = mesh.position.z.toFixed(3); + const geometry = new THREE.SphereGeometry(); + const material = new THREE.MeshBasicMaterial( { color: 'yellow' } ); - renderer.render(scene, camera); + const mesh = new THREE.Mesh( geometry, material ); + scene.add( mesh ); - requestAnimationFrame(render); - } + function resizeRendererToDisplaySize( renderer ) { + + const canvas = renderer.domElement; + const width = canvas.clientWidth; + const height = canvas.clientHeight; + const needResize = canvas.width !== width || canvas.height !== height; + if ( needResize ) { + + renderer.setSize( width, height, false ); + + } + + return needResize; + + } + + const xElem = document.querySelector( '#x' ); + const yElem = document.querySelector( '#y' ); + const zElem = document.querySelector( '#z' ); + + function render( time ) { + + time *= 0.001; // convert to seconds + + if ( resizeRendererToDisplaySize( renderer ) ) { + + const canvas = renderer.domElement; + camera.aspect = canvas.clientWidth / canvas.clientHeight; + camera.updateProjectionMatrix(); + + } + + mesh.position.set( + Math.sin( time * 1.2 ) * 5, + Math.sin( time * 1.1 ) * 5, + Math.sin( time * 1.3 ) * 10, + ); + xElem.textContent = mesh.position.x.toFixed( 3 ); + yElem.textContent = mesh.position.y.toFixed( 3 ); + zElem.textContent = mesh.position.z.toFixed( 3 ); + + renderer.render( scene, camera ); + + requestAnimationFrame( render ); + + } + + requestAnimationFrame( render ); - requestAnimationFrame(render); } main(); diff --git a/manual/examples/debug-js-params.html b/manual/examples/debug-js-params.html index 3ea80b6b8969b6..6cc9586d21ec2b 100644 --- a/manual/examples/debug-js-params.html +++ b/manual/examples/debug-js-params.html @@ -73,137 +73,180 @@ * name: 'gman', * } */ - function getQuery() { - const params = {}; - const q = (window.location.search || '').substring(1); - q.split('&').forEach((pair) => { - const keyValue = pair.split('=').map(decodeURIComponent); - params[keyValue[0]] = keyValue[1]; - }); - return params; +function getQuery() { + + const params = {}; + const q = ( window.location.search || '' ).substring( 1 ); + q.split( '&' ).forEach( ( pair ) => { + + const keyValue = pair.split( '=' ).map( decodeURIComponent ); + params[ keyValue[ 0 ] ] = keyValue[ 1 ]; + + } ); + return params; + } class DummyLogger { - log() {} - render() {} + + log() {} + render() {} + } class ClearingLogger { - constructor(elem) { - this.elem = elem; - this.lines = []; - } - log(...args) { - this.lines.push([...args].join(' ')); - } - render() { - this.elem.textContent = this.lines.join('\n'); - this.lines = []; - } + + constructor( elem ) { + + this.elem = elem; + this.lines = []; + + } + log( ...args ) { + + this.lines.push( [ ...args ].join( ' ' ) ); + + } + render() { + + this.elem.textContent = this.lines.join( '\n' ); + this.lines = []; + + } + } const query = getQuery(); const debug = query.debug === 'true'; const logger = debug - ? new ClearingLogger(document.querySelector('#debug pre')) - : new DummyLogger(); -if (debug) { - document.querySelector('#debug').style.display = ''; + ? new ClearingLogger( document.querySelector( '#debug pre' ) ) + : new DummyLogger(); +if ( debug ) { + + document.querySelector( '#debug' ).style.display = ''; + } function main() { - const canvas = document.querySelector('#c'); - const renderer = new THREE.WebGLRenderer({antialias: true, canvas}); - const fov = 75; - const aspect = 2; // the canvas default - const near = 0.1; - const far = 50; - const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); - camera.position.z = 20; + const canvas = document.querySelector( '#c' ); + const renderer = new THREE.WebGLRenderer( { antialias: true, canvas } ); + renderer.useLegacyLights = false; - const scene = new THREE.Scene(); - scene.background = new THREE.Color('cyan'); + const fov = 75; + const aspect = 2; // the canvas default + const near = 0.1; + const far = 50; + const camera = new THREE.PerspectiveCamera( fov, aspect, near, far ); + camera.position.z = 20; - const geometry = new THREE.SphereGeometry(); - const material = new THREE.MeshBasicMaterial({color: 'red'}); + const scene = new THREE.Scene(); + scene.background = new THREE.Color( 'cyan' ); - const things = []; + const geometry = new THREE.SphereGeometry(); + const material = new THREE.MeshBasicMaterial( { color: 'red' } ); - function rand(min, max) { - if (max === undefined) { - max = min; - min = 0; - } - return Math.random() * (max - min) + min; - } + const things = []; - function createThing() { - const mesh = new THREE.Mesh(geometry, material); - scene.add(mesh); - things.push({ - mesh, - timer: 2, - velocity: new THREE.Vector3(rand(-5, 5), rand(-5, 5), rand(-5, 5)), - }); - } + function rand( min, max ) { - canvas.addEventListener('click', createThing); + if ( max === undefined ) { - function resizeRendererToDisplaySize(renderer) { - const canvas = renderer.domElement; - const width = canvas.clientWidth; - const height = canvas.clientHeight; - const needResize = canvas.width !== width || canvas.height !== height; - if (needResize) { - renderer.setSize(width, height, false); - } - return needResize; - } + max = min; + min = 0; - let then = 0; - function render(now) { - now *= 0.001; // convert to seconds - const deltaTime = now - then; - then = now; + } - if (resizeRendererToDisplaySize(renderer)) { - const canvas = renderer.domElement; - camera.aspect = canvas.clientWidth / canvas.clientHeight; - camera.updateProjectionMatrix(); - } + return Math.random() * ( max - min ) + min; - if (things.length === 0) { - createThing(); - } + } - logger.log('fps:', (1 / deltaTime).toFixed(1)); - logger.log('num things:', things.length); - for (let i = 0; i < things.length;) { - const thing = things[i]; - const mesh = thing.mesh; - const pos = mesh.position; - logger.log( - 'timer:', thing.timer.toFixed(3), - 'pos:', pos.x.toFixed(3), pos.y.toFixed(3), pos.z.toFixed(3)); - thing.timer -= deltaTime; - if (thing.timer <= 0) { - // remove this thing. Note we don't advance `i` - things.splice(i, 1); - scene.remove(mesh); - } else { - mesh.position.addScaledVector(thing.velocity, deltaTime); - ++i; - } - } + function createThing() { - renderer.render(scene, camera); - logger.render(); + const mesh = new THREE.Mesh( geometry, material ); + scene.add( mesh ); + things.push( { + mesh, + timer: 2, + velocity: new THREE.Vector3( rand( - 5, 5 ), rand( - 5, 5 ), rand( - 5, 5 ) ), + } ); - requestAnimationFrame(render); - } + } + + canvas.addEventListener( 'click', createThing ); + + function resizeRendererToDisplaySize( renderer ) { + + const canvas = renderer.domElement; + const width = canvas.clientWidth; + const height = canvas.clientHeight; + const needResize = canvas.width !== width || canvas.height !== height; + if ( needResize ) { + + renderer.setSize( width, height, false ); + + } + + return needResize; + + } + + let then = 0; + function render( now ) { + + now *= 0.001; // convert to seconds + const deltaTime = now - then; + then = now; + + if ( resizeRendererToDisplaySize( renderer ) ) { + + const canvas = renderer.domElement; + camera.aspect = canvas.clientWidth / canvas.clientHeight; + camera.updateProjectionMatrix(); + + } + + if ( things.length === 0 ) { + + createThing(); + + } + + logger.log( 'fps:', ( 1 / deltaTime ).toFixed( 1 ) ); + logger.log( 'num things:', things.length ); + for ( let i = 0; i < things.length; ) { + + const thing = things[ i ]; + const mesh = thing.mesh; + const pos = mesh.position; + logger.log( + 'timer:', thing.timer.toFixed( 3 ), + 'pos:', pos.x.toFixed( 3 ), pos.y.toFixed( 3 ), pos.z.toFixed( 3 ) ); + thing.timer -= deltaTime; + if ( thing.timer <= 0 ) { + + // remove this thing. Note we don't advance `i` + things.splice( i, 1 ); + scene.remove( mesh ); + + } else { + + mesh.position.addScaledVector( thing.velocity, deltaTime ); + ++ i; + + } + + } + + renderer.render( scene, camera ); + logger.render(); + + requestAnimationFrame( render ); + + } + + requestAnimationFrame( render ); - requestAnimationFrame(render); } main(); diff --git a/manual/examples/debugging-mcve.html b/manual/examples/debugging-mcve.html index 3830be11e50bcb..bd7a126371c611 100644 --- a/manual/examples/debugging-mcve.html +++ b/manual/examples/debugging-mcve.html @@ -16,128 +16,145 @@ diff --git a/manual/fr/fundamentals.html b/manual/fr/fundamentals.html index 024556094083f7..d71f12f9c2d66f 100644 --- a/manual/fr/fundamentals.html +++ b/manual/fr/fundamentals.html @@ -272,7 +272,7 @@

principes de base

un futur article. Pour le moment, créons une lumière directionnelle.

{
   const color = 0xFFFFFF;
-  const intensity = 1;
+  const intensity = 3;
   const light = new THREE.DirectionalLight(color, intensity);
   light.position.set(-1, 2, 4);
   scene.add(light);
diff --git a/manual/ja/backgrounds.html b/manual/ja/backgrounds.html
index b46bba35bc7cb5..312311d7911d52 100644
--- a/manual/ja/backgrounds.html
+++ b/manual/ja/backgrounds.html
@@ -68,6 +68,7 @@ 

の背景とスカイボックス

THREE.jsで簡単にできます。シーンの背景をテクスチャに設定すれば良いのです。

const loader = new THREE.TextureLoader();
 const bgTexture = loader.load('resources/images/daikanyama.jpg');
+bgTexture.colorSpace = THREE.SRGBColorSpace;
 scene.background = bgTexture;
 

このようになります。

@@ -223,9 +224,9 @@

の背景とスカイボックス

+ const texture = loader.load( + 'resources/images/equirectangularmaps/tears_of_steel_bridge_2k.jpg', + () => { -+ const rt = new THREE.WebGLCubeRenderTarget(texture.image.height); -+ rt.fromEquirectangularTexture(renderer, texture); -+ scene.background = rt.texture; ++ texture.mapping = THREE.EquirectangularReflectionMapping; ++ texture.colorSpace = THREE.SRGBColorSpace; ++ scene.background = texture; + }); }
diff --git a/manual/ja/fundamentals.html b/manual/ja/fundamentals.html index 09cfa24a00a0bb..52b3a152f1d503 100644 --- a/manual/ja/fundamentals.html +++ b/manual/ja/fundamentals.html @@ -176,7 +176,7 @@

の基礎知識

とりあえずディレクショナルライトを作成しましょう。

{
   const color = 0xFFFFFF;
-  const intensity = 1;
+  const intensity = 3;
   const light = new THREE.DirectionalLight(color, intensity);
   light.position.set(-1, 2, 4);
   scene.add(light);
diff --git a/manual/ko/backgrounds.html b/manual/ko/backgrounds.html
index 336455912f389a..e16b5e2f2a8eef 100644
--- a/manual/ko/backgrounds.html
+++ b/manual/ko/backgrounds.html
@@ -71,6 +71,7 @@ 

배경과 하늘 상자

간단히 장면의 배경에 텍스처를 입혀주기만 하면 되죠.

const loader = new THREE.TextureLoader();
 const bgTexture = loader.load('resources/images/daikanyama.jpg');
+bgTexture.colorSpace = THREE.SRGBColorSpace;
 scene.background = bgTexture;
 

@@ -228,9 +229,9 @@

배경과 하늘 상자

+ const texture = loader.load( + 'resources/images/equirectangularmaps/tears_of_steel_bridge_2k.jpg', + () => { -+ const rt = new THREE.WebGLCubeRenderTarget(texture.image.height); -+ rt.fromEquirectangularTexture(renderer, texture); -+ scene.background = rt.texture; ++ texture.mapping = THREE.EquirectangularReflectionMapping; ++ texture.colorSpace = THREE.SRGBColorSpace; ++ scene.background = texture; + }); }
diff --git a/manual/ko/fundamentals.html b/manual/ko/fundamentals.html index bd47ddd157d5df..ec9e75b7595d7b 100644 --- a/manual/ko/fundamentals.html +++ b/manual/ko/fundamentals.html @@ -250,7 +250,7 @@

Three.js란?

DirectionalLight를 사용해보도록 하죠.

{
   const color = 0xFFFFFF;
-  const intensity = 1;
+  const intensity = 3;
   const light = new THREE.DirectionalLight(color, intensity);
   light.position.set(-1, 2, 4);
   scene.add(light);
diff --git a/manual/ru/custom-buffergeometry.html b/manual/ru/custom-buffergeometry.html
index e82267f6e18e7b..0a1b08f2b158bf 100644
--- a/manual/ru/custom-buffergeometry.html
+++ b/manual/ru/custom-buffergeometry.html
@@ -31,13 +31,6 @@ 

Пользовательская BufferGeometry

-

В предыдущей статье рассказывалось, как использовать Geometry. Эта статья о BufferGeometry. BufferGeometry обычно быстрее запускается и использует меньше памяти, но может быть сложнее в настройке.

-

В статье о Geometry мы рассказали, что для использования Geometry вы предоставляете массив вершин Vector3 (позиций). -Затем вы создаете объекты Face3, определяя по индексу 3 вершины, которые составляют каждый треугольник фигуры, которую вы делаете. -Для каждого Face3 вы можете указать либо нормаль грани, либо нормали для каждой отдельной вершины грани. -Вы также можете указать цвет грани или отдельные цвета вершин. Наконец, вы можете создать параллельный массив массивов текстурных координат (UV), -один массив для каждой грани, содержащий массив UV, один для каждой вершины грани.

-

BufferGeometry с другой стороны использует названный BufferAttributes. Каждый атрибут BufferAttribute представляет собой массив данных одного типа: позиции, нормали, цвета и ультрафиолетовые лучи. diff --git a/manual/ru/fundamentals.html b/manual/ru/fundamentals.html index 5ad1a0c375d3dc..dfaf4396fd2d12 100644 --- a/manual/ru/fundamentals.html +++ b/manual/ru/fundamentals.html @@ -191,7 +191,7 @@

Основы

следующей статье. А пока давайте создадим направленный свет.

{
   const color = 0xFFFFFF;
-  const intensity = 1;
+  const intensity = 3;
   const light = new THREE.DirectionalLight(color, intensity);
   light.position.set(-1, 2, 4);
   scene.add(light);
diff --git a/manual/zh/backgrounds.html b/manual/zh/backgrounds.html
index 296d0cca1f1a9b..46386dd84a5de0 100644
--- a/manual/zh/backgrounds.html
+++ b/manual/zh/backgrounds.html
@@ -75,6 +75,7 @@ 

背景与天空盒

THREE.js 让这变得非常简单。我们可以将场景的背景设置为一种纹理。

const loader = new THREE.TextureLoader();
 const bgTexture = loader.load('resources/images/daikanyama.jpg');
+bgTexture.colorSpace = THREE.SRGBColorSpace;
 scene.background = bgTexture;

效果如下

@@ -241,9 +242,9 @@

背景与天空盒

+ const texture = loader.load( + 'resources/images/equirectangularmaps/tears_of_steel_bridge_2k.jpg', + () => { -+ const rt = new THREE.WebGLCubeRenderTarget(texture.image.height); -+ rt.fromEquirectangularTexture(renderer, texture); -+ scene.background = rt.texture; ++ texture.mapping = THREE.EquirectangularReflectionMapping; ++ texture.colorSpace = THREE.SRGBColorSpace; ++ scene.background = texture; + }); }

这就是全部要做的事。

diff --git a/manual/zh/custom-buffergeometry.html b/manual/zh/custom-buffergeometry.html index 26ac0f834795f0..53020abf830649 100644 --- a/manual/zh/custom-buffergeometry.html +++ b/manual/zh/custom-buffergeometry.html @@ -377,8 +377,7 @@

自定义缓冲几何体

我希望这些例子能对如何使用 BufferGeometry 直接创建你自己的几何体和如何动态更新 BufferAttribute 的内容发挥作用。

-

-

+

diff --git a/manual/zh/fundamentals.html b/manual/zh/fundamentals.html index 1cd6cd393cd4b0..0e754c911ebfdd 100644 --- a/manual/zh/fundamentals.html +++ b/manual/zh/fundamentals.html @@ -181,7 +181,7 @@

基础

效果好了一些但还是很难看出是三维的。我们来添加些光照效果,应该会有点帮助。three.js中有很多种类型的灯光,我们将在后期文章中详细讨论。现在我们先创建一盏平行光。

{
   const color = 0xFFFFFF;
-  const intensity = 1;
+  const intensity = 3;
   const light = new THREE.DirectionalLight(color, intensity);
   light.position.set(-1, 2, 4);
   scene.add(light);