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
d0665689979805ab3e0e15572f3e5e0d231ceb48.json
change onChange to updateLight
threejs/threejs-lights-point.html
@@ -116,12 +116,14 @@ const helper = new THREE.PointLightHelper(light); scene.add(helper); - const onChange = helper.update.bind(helper); + function updateLight() { + helper.update(); + } const gui = new dat.GUI(); gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color'); gui.add(light, 'intensity', 0, 2); - gui.add(light, 'distance', 0, 40).onChange(onChange); + gui.add(light, 'distance', 0, 40).onChange(updateLight); makeXYZGUI(gui, light.position, 'position'); }
true
Other
mrdoob
three.js
d0665689979805ab3e0e15572f3e5e0d231ceb48.json
change onChange to updateLight
threejs/threejs-lights-rectarea.html
@@ -133,18 +133,20 @@ const helper = new THREE.RectAreaLightHelper(light); scene.add(helper); - const onChange = helper.update.bind(helper); + function updateLight() { + helper.update(); + } const gui = new dat.GUI(); gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color'); gui.add(light, 'intensity', 0, 10); - gui.add(light, 'width', 0, 20).onChange(onChange); - gui.add(light, 'height', 0, 20).onChange(onChange); - gui.add(new DegRadHelper(light.rotation, 'x'), 'value', -180, 180).name('x rotation').onChange(onChange); - gui.add(new DegRadHelper(light.rotation, 'y'), 'value', -180, 180).name('y rotation').onChange(onChange); - gui.add(new DegRadHelper(light.rotation, 'z'), 'value', -180, 180).name('z rotation').onChange(onChange); + gui.add(light, 'width', 0, 20).onChange(updateLight); + gui.add(light, 'height', 0, 20).onChange(updateLight); + gui.add(new DegRadHelper(light.rotation, 'x'), 'value', -180, 180).name('x rotation').onChange(updateLight); + gui.add(new DegRadHelper(light.rotation, 'y'), 'value', -180, 180).name('y rotation').onChange(updateLight); + gui.add(new DegRadHelper(light.rotation, 'z'), 'value', -180, 180).name('z rotation').onChange(updateLight); - makeXYZGUI(gui, light.position, 'position', onChange); + makeXYZGUI(gui, light.position, 'position', updateLight); } function resizeRendererToDisplaySize(renderer) {
true
Other
mrdoob
three.js
d0665689979805ab3e0e15572f3e5e0d231ceb48.json
change onChange to updateLight
threejs/threejs-lights-spot-w-helper.html
@@ -131,21 +131,21 @@ const helper = new THREE.SpotLightHelper(light); scene.add(helper); - const onChange = () => { + function updateLight() { light.target.updateMatrixWorld(); helper.update(); - }; - onChange(); + } + updateLight(); const gui = new dat.GUI(); gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color'); gui.add(light, 'intensity', 0, 2); - gui.add(light, 'distance', 0, 40).onChange(onChange); - gui.add(new DegRadHelper(light, 'angle'), 'value', 0, 90).name('angle').onChange(onChange); + gui.add(light, 'distance', 0, 40).onChange(updateLight); + gui.add(new DegRadHelper(light, 'angle'), 'value', 0, 90).name('angle').onChange(updateLight); gui.add(light, 'penumbra', 0, 1); - makeXYZGUI(gui, light.position, 'position', onChange); - makeXYZGUI(gui, light.target.position, 'target', onChange); + makeXYZGUI(gui, light.position, 'position', updateLight); + makeXYZGUI(gui, light.target.position, 'target', updateLight); } function resizeRendererToDisplaySize(renderer) {
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/background.html
@@ -42,9 +42,9 @@ const aspect = 2; // the canvas default const fov = 35; - const zNear = 0.1; - const zFar = 5000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.x = -0.; camera.position.y = 350; camera.position.z = 40.;
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/resources/frustum-3d.svg
@@ -57,11 +57,11 @@ <path d="M268.458,558.348C288.79,525.842 354.8,502 433,502C511.2,502 577.21,525.842 597.542,558.348C552.951,545.022 495.572,537 433,537C370.428,537 313.049,545.022 268.458,558.348Z" style="stroke:rgb(146,146,146);stroke-width:3.56px;"/> </g> </g> - <g transform="matrix(0.451826,0.00669686,-0.00669686,0.451826,-756.233,-852.788)"> - <text x="1932.37px" y="2074.34px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:101.279px;fill:rgb(0,59,255);">zFar</text> + <g transform="matrix(0.451826,0.00669686,-0.00669686,0.451826,-703.233,-850.788)"> + <text x="1932.37px" y="2074.34px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:101.279px;fill:rgb(0,59,255);">far</text> </g> - <g transform="matrix(0.451826,0.00669686,-0.00669686,0.451826,-831.517,-741.628)"> - <text x="1932.37px" y="2074.34px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:101.279px;fill:rgb(42,170,74);">zNear</text> + <g transform="matrix(0.451826,0.00669686,-0.00669686,0.451826,-803.517,-741.628)"> + <text x="1932.37px" y="2074.34px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:101.279px;fill:rgb(42,170,74);">near</text> </g> <g transform="matrix(0.451826,0.00669686,-0.00669686,0.451826,-585.526,-533.656)"> <text x="1932.37px" y="2074.34px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:101.279px;fill:rgb(255,0,48);">fov</text>
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/resources/threejs-lesson-utils.js
@@ -80,9 +80,9 @@ window.threejsLessonUtils = { const scene = new THREE.Scene(); let targetFOVDeg = 60; const aspect = 1; - const zNear = 0.1; - const zFar = 50; - let camera = new THREE.PerspectiveCamera(targetFOVDeg, aspect, zNear, zFar); + const near = 0.1; + const far = 50; + let camera = new THREE.PerspectiveCamera(targetFOVDeg, aspect, near, far); camera.position.z = 15; scene.add(camera);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/resources/threejs-textures.js
@@ -144,7 +144,7 @@ async create(props) { const { scene, camera, renderInfo } = props; scene.background = new THREE.Color('black'); - camera.zFar = 150; + camera.far = 150; const texture = await filterTexturePromise; const root = new THREE.Object3D(); const depth = 50;
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/threejs-fog.md
@@ -150,12 +150,12 @@ We can then add it like this scene.background = new THREE.Color(color); + + const fogGUIHelper = new FogGUIHelper(scene.fog); -+ gui.add(fogGUIHelper, 'near', zNear, zFar).listen(); -+ gui.add(fogGUIHelper, 'far', zNear, zFar).listen(); ++ gui.add(fogGUIHelper, 'near', near, far).listen(); ++ gui.add(fogGUIHelper, 'far', near, far).listen(); } ``` -The `zNear` and `zFar` parameter set the minimum and maximum values +The `near` and `far` parameter set the minimum and maximum values for adjusting the fog. They are set when we setup the camera. The `.listen()` at the end of the last 2 lines tells dat.GUI to *listen* @@ -222,8 +222,8 @@ We then call `gui.addColor` to add a color UI for our helper's virutal property. scene.background = new THREE.Color(color); * const fogGUIHelper = new FogGUIHelper(scene.fog, scene.background); - gui.add(fogGUIHelper, 'near', zNear, zFar).listen(); - gui.add(fogGUIHelper, 'far', zNear, zFar).listen(); + gui.add(fogGUIHelper, 'near', near, far).listen(); + gui.add(fogGUIHelper, 'far', near, far).listen(); + gui.addColor(fogGUIHelper, 'color'); } ```
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/threejs-fundamentals.md
@@ -70,9 +70,9 @@ Next up we need a camera. ``` const fov = 75; const aspect = 2; // the canvas default -const zNear = 0.1; -const zFar = 5; -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +const near = 0.1; +const far = 5; +const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); ``` `fov` is short for `field of view`. In this case 75 degrees in the vertical @@ -83,7 +83,7 @@ reason the perspective camera takes degrees. in another article but by default a canvas is 300x150 pixels which makes the aspect 300/150 or 2. -`zNear` and `zFar` represent the space in front of the camera +`near` and `far` represent the space in front of the camera that will be rendered. Anything before that range or after that range will be clipped (not drawn). @@ -94,7 +94,7 @@ cube, prism, frustum. <img src="resources/frustum-3d.svg" width="500" class="threejs_center"/> -The height of the zNear and zFar planes are determined by the field of view. +The height of the near and far planes are determined by the field of view. The width of both planes is determined by the field of view and the aspect. Anything inside the defined frustum will be be drawn. Anything outside
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/threejs-lights.md
@@ -16,9 +16,9 @@ and we'll move the camera 10 units up and 20 units back from the origin ```javascript *const fov = 45; const aspect = 2; // the canvas default -const zNear = 0.1; -*const zFar = 100; -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +const near = 0.1; +*const far = 100; +const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); +camera.position.set(0, 10, 20); ```
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/threejs-primitives.md
@@ -95,10 +95,10 @@ objects. -const fov = 75; +const fov = 40; const aspect = 2; // the canvas default -const zNear = 0.1; --const zFar = 5; -+const zFar = 1000; -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +const near = 0.1; +-const far = 5; ++const far = 1000; +const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); -camera.position.z = 2; +camera.position.z = 120; ```
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/lessons/threejs-scenegraph.md
@@ -94,7 +94,7 @@ camera. For most situations positive Y being up is good enough but since we are looking straight down we need to tell the camera that positive Z is up. ``` -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-fog-gui.html
@@ -33,9 +33,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene(); @@ -81,8 +81,8 @@ scene.background = new THREE.Color(color); const fogGUIHelper = new FogGUIHelper(scene.fog, scene.background); - gui.add(fogGUIHelper, 'near', zNear, zFar).listen(); - gui.add(fogGUIHelper, 'far', zNear, zFar).listen(); + gui.add(fogGUIHelper, 'near', near, far).listen(); + gui.add(fogGUIHelper, 'far', near, far).listen(); gui.addColor(fogGUIHelper, 'color'); }
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-fog.html
@@ -29,9 +29,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-fundamentals-3-cubes.html
@@ -19,9 +19,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-fundamentals-with-animation.html
@@ -19,9 +19,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-fundamentals-with-light.html
@@ -19,9 +19,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-fundamentals.html
@@ -19,9 +19,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-ambient.html
@@ -34,9 +34,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-directional-w-helper.html
@@ -34,9 +34,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-directional.html
@@ -34,9 +34,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-hemisphere.html
@@ -34,9 +34,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-point-physically-correct.html
@@ -35,9 +35,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-point.html
@@ -34,9 +34,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-rectarea.html
@@ -35,9 +35,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-lights-spot-w-helper.html
@@ -34,9 +34,9 @@ const fov = 45; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 100; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 100; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 10, 20); const controls = new THREE.OrbitControls(camera, canvas);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-primitives-text.html
@@ -30,9 +30,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 40; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-primitives.html
@@ -30,9 +30,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 120; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-responsive-hd-dpi.html
@@ -30,9 +30,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-responsive-no-resize.html
@@ -30,9 +30,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-responsive-update-camera.html
@@ -30,9 +30,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-responsive.html
@@ -29,9 +29,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-responsive.js
@@ -6,9 +6,9 @@ function main() { const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-car.html
@@ -31,9 +31,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(8, 4, 10); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun-earth-moon-axes-grids.html
@@ -59,9 +59,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun-earth-moon-axes.html
@@ -29,9 +29,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun-earth-moon.html
@@ -29,9 +29,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun-earth-orbit-fixed.html
@@ -29,9 +29,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun-earth-orbit.html
@@ -29,9 +29,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 150, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun-earth.html
@@ -29,9 +29,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-scenegraph-sun.html
@@ -29,9 +29,9 @@ const fov = 40; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 1000; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 1000; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.set(0, 50, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-textured-cube-6-textures.html
@@ -29,9 +29,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-textured-cube-adjust.html
@@ -32,9 +32,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-textured-cube-wait-for-all-textures.html
@@ -54,9 +54,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-textured-cube-wait-for-texture.html
@@ -29,9 +29,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
bc86c8b6d72c8f4b4092d76757fd20ba56fdfffd.json
Switch all references to zNear Zfar to near far
threejs/threejs-textured-cube.html
@@ -29,9 +29,9 @@ const fov = 75; const aspect = 2; // the canvas default - const zNear = 0.1; - const zFar = 5; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const near = 0.1; + const far = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); camera.position.z = 2; const scene = new THREE.Scene();
true
Other
mrdoob
three.js
fbf6a820de0a9a6407d471b6634e336a7845b9a2.json
make camera optional
threejs/lessons/resources/threejs-lesson-utils.js
@@ -82,7 +82,7 @@ window.threejsLessonUtils = { const aspect = 1; const zNear = 0.1; const zFar = 50; - const camera = new THREE.PerspectiveCamera(targetFOVDeg, aspect, zNear, zFar); + let camera = new THREE.PerspectiveCamera(targetFOVDeg, aspect, zNear, zFar); camera.position.z = 15; scene.add(camera); @@ -129,6 +129,10 @@ window.threejsLessonUtils = { if (info.resize) { resizeFunctions.push(info.resize); } + if (info.camera) { + camera = info.camera; + renderInfo.camera = camera; + } Object.assign(settings, info); targetFOVDeg = camera.fov;
false
Other
mrdoob
three.js
09ad6fbe8a2a47a1bb202d6a33471f89b3ea77fc.json
add getters/setter to prepreqs
threejs/lessons/threejs-prerequisites.md
@@ -202,7 +202,15 @@ somemesh.position.set(...position); ### Use `class` The syntax for making class like objects pre ES5 was unfamilar to most programmers. -As of ES5 you can now [use the `class` keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +As of ES5 you can now [use the `class` keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) which +is closer to the style of C++/C#/Java. + +### Understand getters and setters + +[Getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) and +[setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) are +common in most modern languages. The `class` syntax +of ES5 makes them much easier than pre ES5. ### Use arrow functions where appropriate
false
Other
mrdoob
three.js
6debd2bf63ead442dd874ebfd503096e5de32544.json
require Capitalized constructors
.eslintrc.json
@@ -57,7 +57,7 @@ "curly": [2, "all"], "no-extra-parens": [2, "functions"], "eqeqeq": 2, - "new-cap": 0, + "new-cap": 2, "new-parens": 2, "semi-spacing": [2, {"before": false, "after": true}], "space-infix-ops": 2,
true
Other
mrdoob
three.js
6debd2bf63ead442dd874ebfd503096e5de32544.json
require Capitalized constructors
threejs/threejs-responsive-editor.html
@@ -57,7 +57,7 @@ // This code is only related to handling the split. // Our three.js code has not changed -Split(['#view', '#controls'], { +Split(['#view', '#controls'], { // eslint-disable-line new-cap sizes: [75, 25], minSize: 100, elementStyle: (dimension, size, gutterSize) => {
true
Other
mrdoob
three.js
7a7cd9d05898a0a3a7c0bcc19cce004754153764.json
fix three.js link
threejs/lessons/toc.html
@@ -17,6 +17,6 @@ </ul> <ul> <li><a href="https://github.com/greggman/threejsfundamentals">github</a></li> - <li><a href="https://three.js">three.js</a></li> + <li><a href="https://threejs.org">three.js</a></li> <li><a href="https://threejs.org/docs/">three.js docs</a></li> </ul>
false
Other
mrdoob
three.js
13993331563c01e98e80b17d278c9914e3685c71.json
fix responsive image size
threejs/lessons/resources/lesson.css
@@ -211,10 +211,12 @@ code { text-align: center; max-width: 95%; } - +.threejs_center>img { + max-width: 100%; +} .threejs_image>img { - max-width: 100% !important; - display: block; + width: 100%; + display: block; } .threejs_math { margin-left: auto;
true
Other
mrdoob
three.js
13993331563c01e98e80b17d278c9914e3685c71.json
fix responsive image size
threejs/lessons/threejs-textures.md
@@ -34,7 +34,7 @@ in some 3rd party program like Photoshop or gIMP. For example let's put this image on cube. <div class="threejs_center"> - <img src="../resources/images/wall.jpg" style="max-width: 600px;" class="border" > + <img src="../resources/images/wall.jpg" style="width: 600px;" class="border" > </div> We'll modify one of our first samples. All we need to do is create a `TextureLoader`. Call its @@ -60,14 +60,14 @@ How about 6 textures, one on each face of a cube? <div class="threejs_center"> <div> - <img src="../resources/images/flower-1.jpg" style="max-width: 100px;" class="border" > - <img src="../resources/images/flower-2.jpg" style="max-width: 100px;" class="border" > - <img src="../resources/images/flower-3.jpg" style="max-width: 100px;" class="border" > + <img src="../resources/images/flower-1.jpg" style="width: 100px;" class="border" > + <img src="../resources/images/flower-2.jpg" style="width: 100px;" class="border" > + <img src="../resources/images/flower-3.jpg" style="width: 100px;" class="border" > </div> <div> - <img src="../resources/images/flower-4.jpg" style="max-width: 100px;" class="border" > - <img src="../resources/images/flower-5.jpg" style="max-width: 100px;" class="border" > - <img src="../resources/images/flower-6.jpg" style="max-width: 100px;" class="border" > + <img src="../resources/images/flower-4.jpg" style="width: 100px;" class="border" > + <img src="../resources/images/flower-5.jpg" style="width: 100px;" class="border" > + <img src="../resources/images/flower-6.jpg" style="width: 100px;" class="border" > </div> </div> @@ -266,7 +266,7 @@ Notice that says nothing about compression. I can make a .jpg image and set its high. For example let's say I was making a scene of a house. Inside the house there is a table and I decide to put this wood texture on the top surface of the table -<div class="threejs_center"><img class="border" src="resources/images/compressed-but-large-wood-texture.jpg" align="center" style="max-width: 300px"></div> +<div class="threejs_center"><img class="border" src="resources/images/compressed-but-large-wood-texture.jpg" align="center" style="width: 300px"></div> That image is only 157k so it will download relatively quickly but [it is actually 3024 x 3761 pixels in size](resources/images/compressed-but-large-wood-texture.jpg).
true
Other
mrdoob
three.js
8cda0f9df7c926db813b4ccddf583dd29f88c93a.json
add lighttheme for code
threejs/lessons/resources/lesson.css
@@ -360,6 +360,28 @@ pre.prettyprint, code.prettyprint { width: calc(100% - 80px); } +pre.prettyprint.lighttheme, code.prettyprint.lighttheme { + color: #222; + background: #fff; + border: 1px solid #888; + box-shadow: none; +} + +pre.prettyprint.lighttheme .str { color: #183691; } /* string content */ +pre.prettyprint.lighttheme .kwd { color: #a71d5d; } /* keyword */ +pre.prettyprint.lighttheme .com { color: #969896; } /* comment */ +pre.prettyprint.lighttheme .typ { color: #0086b3; } /* type name */ +pre.prettyprint.lighttheme .lit { color: #0086b3; } /* literal value */ +pre.prettyprint.lighttheme .pun { color: #333; } /* punctuation */ +pre.prettyprint.lighttheme .opn { color: #333; } /* lisp open bracket */ +pre.prettyprint.lighttheme .clo { color: #333; } /* lisp close bracket */ +pre.prettyprint.lighttheme .tag { color: #000080; } /* markup tag name */ +pre.prettyprint.lighttheme .atn { color: #795da3; } /* markup attribute name */ +pre.prettyprint.lighttheme .atv { color: #183691; } /* markup attribute value */ +pre.prettyprint.lighttheme .dec { color: #333; } /* declaration */ +pre.prettyprint.lighttheme .var { color: #008080; } /* variable name */ +pre.prettyprint.lighttheme .fun { color: #900; } /* function name */ + @media print { pre.prettyprint .str, code.prettyprint .str{color:#060} pre.prettyprint .kwd, code.prettyprint .kwd{color:#006;font-weight:bold}
false
Other
mrdoob
three.js
13027d48f18fa43f3e93d60c75661cd598965b5b.json
add code snippets to primitives
threejs/lessons/resources/threejs-primitives.js
@@ -89,33 +89,34 @@ }, }, ParametricBufferGeometry: { - create() { - /* - from: https://github.com/mrdoob/three.js/blob/b8d8a8625465bd634aa68e5846354d69f34d2ff5/examples/js/ParametricGeometries.js + /* + from: https://github.com/mrdoob/three.js/blob/b8d8a8625465bd634aa68e5846354d69f34d2ff5/examples/js/ParametricGeometries.js - The MIT License + The MIT License - Copyright © 2010-2018 three.js authors + Copyright © 2010-2018 three.js authors - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. - */ + */ + create() { + // from: https://github.com/mrdoob/three.js/blob/b8d8a8625465bd634aa68e5846354d69f34d2ff5/examples/js/ParametricGeometries.js function klein(v, u, target) { u *= Math.PI; v *= 2 * Math.PI; @@ -403,16 +404,25 @@ const text = base.innerHTML; base.innerHTML = ''; - const elem = addDiv(base, 'shape'); + const pair = addDiv(base, 'pair'); + const elem = addDiv(pair, 'shape'); - const right = addDiv(base, 'desc'); + const right = addDiv(pair, 'desc'); addLink(right, name); if (info.nonBuffer !== false) { addElem(right, 'span', '', ', '); addLink(right, name.replace('Buffer', '')); } addDiv(right, '.note').innerHTML = text; + const rawLines = info.create.toString().replace('return new', 'const geometry =').split(/\n/); + const createRE = /^( *create\()/; + const m = createRE.exec(rawLines[0]); + const prefixLen = m[1].length + 1; + const trimmedLines = rawLines.slice(1, rawLines.length - 1).map(line => line.substring(prefixLen)); + + addElem(base, 'pre', 'prettyprint showmods', trimmedLines.join('\n')); + return createLiveImage(elem, info); }
true
Other
mrdoob
three.js
13027d48f18fa43f3e93d60c75661cd598965b5b.json
add code snippets to primitives
threejs/lessons/threejs-primitives.md
@@ -19,7 +19,6 @@ cover making and loading data from several 3D modeling programs. For now let's go over some of the available primitives. -<div class="primitives"> <div data-primitive="BoxBufferGeometry">A Box</div> <div data-primitive="CircleBufferGeometry">A flat circle</div> <div data-primitive="ConeBufferGeometry">A Cone</div> @@ -44,7 +43,6 @@ for <code>TextBufferGeometry</code> and <code>TextGeometry</code> respectively.< <div data-primitive="TubeBufferGeometry">A circle traced down a path</div> <div data-primitive="EdgesGeometry">A helper object that takes another geometry as input and generates edges only if the angle between faces is greater than some threshold. For example if you look at the box at the top it shows a line going through each face showing every triangle that makes the box. Using an EdgesGeometry instead the middle lines are removed.</div> <div data-primitive="WireframeGeometry">Generates geometry that contains one line segment (2 points) per edge in the given geometry. With out this you'd often be missing edges or get extra edges since WebGL generally requires 2 points per line segment. For example if all you had was a single triangle there would only be 3 points. If you tried to draw it using a material with <code>wireframe: true</code> you would only get a single line. Passing that triangle geometry to a <code>WireframeGeometry</code> will generate a new Geometry that has 3 lines segments using 6 points..</div> -</div> You might notice of most of them come in pairs of `Geometry` or `BufferGeometry`. The difference between the 2 types is effectively flexibility @@ -346,33 +344,36 @@ to use it](threejs-scenegraph.html). <script src="resources/threejs-lesson-utils.js"></script> <script src="resources/threejs-primitives.js"></script> <style> -.primitives { +div[data-primitive] { + padding-bottom: 2em; + border-bottom: 1px solid #888; + margin-bottom: 2em; } -.primitives>div { +div[data-primitive] .pair { display: flex; align-items: center; margin-bottom: 1em; } -.primitives .shape { +div[data-primitive] .shape { flex: 0 0 auto; width: 200px; height: 200px; } -.primitives .desc { +div[data-primitive] .desc { word-wrap: break-word; padding: 1em; min-width: 0; } -.primitives .desc code { +div[data-primitive] .desc code { white-space: normal; } @media (max-width: 550px) { - .primitives .shape { + div[data-primitive] .shape { width: 120px; height: 120px; } } -.primitives .desc { +div[data-primitive] .desc { flex: 1 1 auto; } </style>
true
Other
mrdoob
three.js
ca824254777002d51c7bf48f9f6fc2ca9fcd8454.json
fix house scene so no trackback input
threejs/lessons/resources/threejs-fog.js
@@ -46,7 +46,7 @@ scene.add(gltf.scene); }); - camera.fov = 30; + camera.fov = 45; camera.position.set(0.4, 1, 1.7); camera.lookAt(1, 1, 0.7); @@ -62,6 +62,7 @@ const target = [1, 1, 0.7]; return { + trackball: false, obj3D: new THREE.Object3D(), update: (time) => { camera.lookAt(target[0] + Math.sin(time * .25) * .5, target[1], target[2]);
false
Other
mrdoob
three.js
65d6bb7ba09261858930ab4a19781a640739ee32.json
add more options to threejs-lesson-utils
threejs/lessons/resources/threejs-lesson-utils.js
@@ -78,11 +78,11 @@ window.threejsLessonUtils = { this.init(); const scene = new THREE.Scene(); - const fov = 60; + let targetFOVDeg = 60; const aspect = 1; const zNear = 0.1; const zFar = 50; - const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + const camera = new THREE.PerspectiveCamera(targetFOVDeg, aspect, zNear, zFar); camera.position.z = 15; scene.add(camera); @@ -92,29 +92,42 @@ window.threejsLessonUtils = { const root = new THREE.Object3D(); scene.add(root); - const controls = new THREE.TrackballControls(camera, elem); - controls.noZoom = true; - controls.noPan = true; - - // add the lights as children of the camera. - // this is because TrackbacllControls move the camera. - // We really want to rotate the object itself but there's no - // controls for that so we fake it by putting all the lights - // on the camera so they move with it. - camera.add(new THREE.HemisphereLight(0xaaaaaa, 0x444444, .5)); - const light = new THREE.DirectionalLight(0xffffff, 1); - light.position.set(-1, 2, 4 - 15); - camera.add(light); - - let updateFunction; + const resizeFunctions = []; + const updateFunctions = []; promise.then((result) => { const info = result instanceof THREE.Object3D ? { obj3D: result, } : result; - const { obj3D, update } = info; + const { obj3D, update, trackball, lights } = info; root.add(obj3D); - updateFunction = update; + + targetFOVDeg = camera.fov; + + if (trackball !== false) { + const controls = new THREE.TrackballControls(camera, elem); + controls.noZoom = true; + controls.noPan = true; + resizeFunctions.push(controls.handleResize.bind(controls)); + updateFunctions.push(controls.update.bind(controls)); + } + + if (update) { + updateFunctions.push(update); + } + + // add the lights as children of the camera. + // this is because TrackbacllControls move the camera. + // We really want to rotate the object itself but there's no + // controls for that so we fake it by putting all the lights + // on the camera so they move with it. + if (lights !== false) { + camera.add(new THREE.HemisphereLight(0xaaaaaa, 0x444444, .5)); + const light = new THREE.DirectionalLight(0xffffff, 1); + light.position.set(-1, 2, 4 - 15); + camera.add(light); + } + }); let oldWidth = -1; @@ -138,21 +151,16 @@ window.threejsLessonUtils = { if (width !== oldWidth || height !== oldHeight) { oldWidth = width; oldHeight = height; - controls.handleResize(); - } - controls.update(); - - if (updateFunction) { - updateFunction(time); + resizeFunctions.forEach(fn => fn()); } + updateFunctions.forEach(fn => fn(time)); const aspect = width / height; - const targetFov = THREE.Math.degToRad(60); - const fov = aspect >= 1 - ? targetFov - : (2 * Math.atan(Math.tan(targetFov * .5) / aspect)); + const fovDeg = aspect >= 1 + ? targetFOVDeg + : THREE.Math.radToDeg(2 * Math.atan(Math.tan(THREE.Math.degToRad(targetFOVDeg) * .5) / aspect)); - camera.fov = THREE.Math.radToDeg(fov); + camera.fov = fovDeg; camera.aspect = aspect; camera.updateProjectionMatrix();
false
Other
mrdoob
three.js
b9d095049e6673835b9055e245bb69d9386fd801.json
handle more autolinks In particular a relative link to "Material" or a link to "Material.property" will get translated into a link to the docs.
threejs/lessons/resources/lesson.js
@@ -276,6 +276,24 @@ $(document).ready(function($){ return a; }); + const methodPropertyRE = /^(\w+).(\w+)$/; + const classRE = /^(\w+)$/; + $('a').each(function() { + const href = this.getAttribute('href'); + const m = methodPropertyRE.exec(href); + if (m) { + const codeKeywordLink = codeKeywordLinks[m[1]]; + if (codeKeywordLink) { + this.setAttribute('href', `${codeKeywordLink}#${m[2]}`); + } + } else if (classRE.test(href)) { + const codeKeywordLink = codeKeywordLinks[href]; + if (codeKeywordLink) { + this.setAttribute('href', codeKeywordLink); + } + } + }); + const linkImgs = function(bigHref) { return function() { const a = document.createElement('a');
false
Other
mrdoob
three.js
c7c0f9f148edd4fa724c1821dd5ddb5c4fb14d4e.json
fix image borders
build/js/build.js
@@ -158,7 +158,7 @@ Handlebars.registerHelper('image', function(options) { options.hash.examplePath = options.data.root.examplePath; options.hash.className = options.hash.className || ''; - options.hash.caption = options.hash.caption || ''; + options.hash.caption = options.hash.caption || undefined; if (options.hash.url.substring(0, 4) === 'http') { options.hash.examplePath = '';
true
Other
mrdoob
three.js
c7c0f9f148edd4fa724c1821dd5ddb5c4fb14d4e.json
fix image borders
threejs/lessons/resources/lesson.css
@@ -214,6 +214,7 @@ code { .threejs_image>img { width: 100%; + display: block; } .threejs_math { margin-left: auto;
true
Other
mrdoob
three.js
c7c0f9f148edd4fa724c1821dd5ddb5c4fb14d4e.json
fix image borders
threejs/lessons/threejs-setup.md
@@ -19,7 +19,7 @@ Next download one of these simple web servers If you'd prefer a web server with a user interface there's [Servez](https://greggman.github.io/servez) -{{{image url="resources/servez.gif" }}} +{{{image url="resources/servez.gif" className="border" }}} Just point it at the folder where you unzipped the files, click "Start", then go to in your browser [`http://localhost:8080/`](http://localhost:8080/) or if you'd
true
Other
mrdoob
three.js
fb92c1e58bd0fb15f5e60a7655ce9f25528583fe.json
add fog, no fog example
threejs/lessons/resources/lesson.css
@@ -53,6 +53,9 @@ div[data-diagram] { height: 100vh; z-index: -100; } +.border { + border: 1px solid black; +} .threejs_navbar>div,
true
Other
mrdoob
three.js
fb92c1e58bd0fb15f5e60a7655ce9f25528583fe.json
add fog, no fog example
threejs/lessons/resources/threejs-fog.js
@@ -13,6 +13,63 @@ return new THREE.Mesh(geometry, material); } + function houseScene(props, fogInHouse) { + const {scene, camera} = props; + camera.far = 200; + const loader = new THREE.GLTFLoader(); + const settings = { + shininess: 0, + roughness: 1, + metalness: 0, + side: THREE.DoubleSide, + }; + loader.load('../resources/models/simple_house_scene/scene.gltf', (gltf) => { + const materials = new Set(); + gltf.scene.traverse((node) => { + const material = node.material; + if (material) { + (Array.isArray(material) ? material : [material]).forEach((material) => { + if (!materials.has(material)) { + materials.add(material); + for (const [key, value] of Object.entries(settings)) { + if (material[key] !== undefined) { + material[key] = value; + } + } + if (!fogInHouse && material.name.startsWith('fogless')) { + material.fog = false; + } + } + }); + } + }); + scene.add(gltf.scene); + }); + + camera.fov = 30; + camera.position.set(0.4, 1, 1.7); + camera.lookAt(1, 1, 0.7); + + const color = 0xFFFFFF; + const near = 1.5; + const far = 5; + scene.fog = new THREE.Fog(color, near, far); + + const light = new THREE.PointLight(0xFFFFFF, 1); + light.position.copy(camera.position); + light.position.y += 0.2; + scene.add(light); + + const target = [1, 1, 0.7]; + return { + obj3D: new THREE.Object3D(), + update: (time) => { + camera.lookAt(target[0] + Math.sin(time * .25) * .5, target[1], target[2]); + }, + }; + + } + threejsLessonUtils.addDiagrams({ fog: { create(props) { @@ -51,5 +108,15 @@ return fogExample(scene, new THREE.Fog(color, near, far)); }, }, + fogHouseAll: { + create(props) { + return houseScene(props, true); + }, + }, + fogHouseInsideNoFog: { + create(props) { + return houseScene(props, false); + }, + }, }); }
true
Other
mrdoob
three.js
fb92c1e58bd0fb15f5e60a7655ce9f25528583fe.json
add fog, no fog example
threejs/lessons/threejs-fog.md
@@ -73,11 +73,11 @@ scene.background = new THREE.Color('#F00'); // red <div class="spread"> <div> - <div data-diagram="fogBlueBackgroundRed"></div> + <div data-diagram="fogBlueBackgroundRed" class="border"></div> <div class="code">fog blue, background red</div> </div> <div> - <div data-diagram="fogBlueBackgroundBlue"></div> + <div data-diagram="fogBlueBackgroundBlue" class="border"></div> <div class="code">fog blue, background blue</div> </div> </div> @@ -242,10 +242,33 @@ for most materials. As an example of why you might want to turn the fog off, imagine you're making a 3D vehicle simulator with a view from the driver's seat or cockpit. You probably want the fog off for everything inside the vehicle when -viewing from inside the vehicle. +viewing from inside the vehicle. + +A better example might be a house +and thick fog outside house. Let's say the fog is set to start +2 meters away (near = 2) and completely fogged out at 4 meters (far = 4). +Rooms are longer than 2 meters and the house is probably longer +than 4 meters so you need to set the materials for the inside +of the house to not apply fog otherwise when standing inside the +house looking outside the wall at the far end of the room will look +like it's in the fog. + +<div class="spread"> + <div> + <div data-diagram="fogHouseAll" style="height: 300px;" class="border"></div> + <div class="code">fog: true, all</div> + </div> +</div> +<div class="spread"> + <div> + <div data-diagram="fogHouseInsideNoFog" style="height: 300px;" class="border"></div> + <div class="code">fog: true, only outside materials</div> + </div> +</div> <canvas id="c"></canvas> <script src="../resources/threejs/r94/three.min.js"></script> <script src="../resources/threejs/r94/js/controls/TrackballControls.js"></script> +<script src="../resources/threejs/r94/js/loaders/GLTFLoader.js"></script> <script src="resources/threejs-lesson-utils.js"></script> <script src="resources/threejs-fog.js"></script>
true
Other
mrdoob
three.js
fb92c1e58bd0fb15f5e60a7655ce9f25528583fe.json
add fog, no fog example
threejs/resources/models/simple_house_scene/scene.gltf
@@ -0,0 +1,1417 @@ +{ + "asset": { + "version": "2.0", + "generator": "THREE.GLTFExporter" + }, + "scenes": [ + { + "nodes": [ + 21 + ], + "name": "Scene" + } + ], + "scene": 0, + "nodes": [ + { + "matrix": [ + 0.9227992126886213, + 0.3852811693646405, + -4.298000772326909e-10, + 0, + -0.16369263063536083, + 0.39206544036849805, + 0.9052565761575887, + 0, + 0.3487782995701999, + -0.8353700238424101, + 0.424865351822523, + 0, + 2004.713, + -2062.435, + 1553.359, + 1 + ], + "name": "skp_camera_Last_Saved_SketchUp_View", + "camera": 0 + }, + { + "mesh": 0 + }, + { + "mesh": 1 + }, + { + "mesh": 2 + }, + { + "mesh": 3 + }, + { + "mesh": 4 + }, + { + "mesh": 5 + }, + { + "mesh": 6 + }, + { + "mesh": 7 + }, + { + "mesh": 8 + }, + { + "mesh": 9 + }, + { + "mesh": 10 + }, + { + "mesh": 11 + }, + { + "mesh": 12 + }, + { + "mesh": 13 + }, + { + "mesh": 14 + }, + { + "mesh": 15 + }, + { + "mesh": 16 + }, + { + "mesh": 17 + }, + { + "mesh": 18 + }, + { + "name": "SketchUp", + "children": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19 + ] + }, + { + "matrix": [ + 0.0254, + 0, + 0, + 0, + 0, + 5.639932965095795e-18, + -0.0254, + 0, + 0, + 0.0254, + 5.639932965095795e-18, + 0, + 0, + 0, + 0, + 1 + ], + "name": "model 2.dae", + "children": [ + 20 + ] + } + ], + "cameras": [ + { + "type": "perspective", + "perspective": { + "aspectRatio": 0, + "yfov": null, + "zfar": 1000, + "znear": 1 + }, + "name": "PerspectiveCamera" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 504, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 504, + "byteLength": 504, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 1008, + "byteLength": 720, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 1728, + "byteLength": 720, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 2448, + "byteLength": 648, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 3096, + "byteLength": 648, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 3744, + "byteLength": 504, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 4248, + "byteLength": 504, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 4752, + "byteLength": 144, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 4896, + "byteLength": 144, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 5040, + "byteLength": 144, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 5184, + "byteLength": 144, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 5328, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 7056, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 8784, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 10512, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 12240, + "byteLength": 792, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 13032, + "byteLength": 792, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 13824, + "byteLength": 792, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 14616, + "byteLength": 792, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 15408, + "byteLength": 792, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 16200, + "byteLength": 792, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 16992, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 18720, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 20448, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 22176, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 23904, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 25632, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 27360, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 29088, + "byteLength": 1728, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 30816, + "byteLength": 1080, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 31896, + "byteLength": 1080, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 32976, + "byteLength": 72, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 33048, + "byteLength": 72, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 33120, + "byteLength": 72, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 33192, + "byteLength": 72, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 33264, + "byteLength": 2736, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 36000, + "byteLength": 2736, + "target": 34962, + "byteStride": 12 + }, + { + "buffer": 0, + "byteOffset": 38736, + "byteLength": 228, + "target": 34963 + }, + { + "buffer": 0, + "byteOffset": 38964, + "byteLength": 228, + "target": 34963 + } + ], + "buffers": [ + { + "byteLength": 39192, + "uri": "data:application/octet-stream;base64,AEBvQgCAxUIAAAAAAKCAwgAAHMMAAAAAAKCAwgCAxUIAAAAAAKCAwgAAHMMAAAAAAEBvQgCAxUIAAAAAbWU8QgcIvcIAAAAAbWU8QgcIvcIAAAAAAEBvQgCAxUIAAAAAAEBvQgcIvcIAAAAAAKCAwgAAHMMAAAAAbWU8Qm8CCcMAAAAAAEBvQgAAHMMAAAAAbWU8Qm8CCcMAAAAAAKCAwgAAHMMAAAAAbWU8QgcIvcIAAAAAAEBvQgAAHMMAAAAAbWU8Qm8CCcMAAAAAAEBvQm8CCcMAAAAAAEBvQgcIvcKLJnNCbWU8QgcIvcIAAAAAAEBvQgcIvcIAAAAAbWU8QgcIvcIAAAAAAEBvQgcIvcKLJnNCbWU8QgcIvcIAALxAbWU8QgcIvcIAALxAAEBvQgcIvcKLJnNCbWU8QgcIvcKLJnNCbWU8Qm8CCcMAALxAAEBvQm8CCcMAAAAAbWU8Qm8CCcMAAAAAAEBvQm8CCcMAAAAAbWU8Qm8CCcMAALxAAEBvQm8CCcOLJnNCAEBvQm8CCcOLJnNCbWU8Qm8CCcMAALxAbWU8Qm8CCcOLJnNCAEBvQgcIvcKLJnNCbWU8Qm8CCcOLJnNCbWU8QgcIvcKLJnNCbWU8Qm8CCcOLJnNCAEBvQgcIvcKLJnNCAEBvQm8CCcOLJnNCAAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAAAAAAAAAAAAIC/AAA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AAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAAAgAAAAIAAAIA/AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBDAEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAVwBYAFkAWgBbAFwAXQBeAF8AYABhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHoAewB8AH0AfgB/AIAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAKEAogCjAKQApQCmAKcAqACpAKoAqwCsAK0ArgCvALAAsQCyALMAtAC1ALYAtwC4ALkAugC7ALwAvQC+AL8AwADBAMIAwwDEAMUAxgDHAMgAyQDKAMsAzADNAM4AzwDQANEA0gDTANQA1QDWANcA2ADZANoA2wDcAN0A3gDfAOAA4QDiAOMA" + } + ], + "accessors": [ + { + "bufferView": 0, + "componentType": 5126, + "count": 42, + "max": [ + 59.8125, + 98.75, + 60.78763961791992 + ], + "min": [ + -64.3125, + -156, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 1, + "componentType": 5126, + "count": 42, + "max": [ + 0, + 1, + 0 + ], + "min": [ + 0, + -1, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 2, + "componentType": 5126, + "count": 60, + "max": [ + 59.8125, + 98.75, + 76.125 + ], + "min": [ + -64.3125, + -156, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 3, + "componentType": 5126, + "count": 60, + "max": [ + 1, + 1, + 0 + ], + "min": [ + -1, + -1, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 4, + "componentType": 5126, + "count": 54, + "max": [ + 59.8125, + 98.75, + 76.125 + ], + "min": [ + -64.3125, + -156, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 5, + "componentType": 5126, + "count": 54, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -3.5847939796516837e-17, + -1.2902049693149968e-17, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 6, + "componentType": 5126, + "count": 42, + "max": [ + 47.09904861450195, + 77.99043273925781, + 76.125 + ], + "min": [ + -46.21345138549805, + -143.1345977783203, + 5.875 + ], + "type": "VEC3" + }, + { + "bufferView": 7, + "componentType": 5126, + "count": 42, + "max": [ + 0, + 0, + 0 + ], + "min": [ + -1, + -1, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 8, + "componentType": 5126, + "count": 12, + "max": [ + 59.8125, + 10.347769737243652, + 53.79964828491211 + ], + "min": [ + 47.09904861450195, + -57.52722930908203, + 26.674650192260742 + ], + "type": "VEC3" + }, + { + "bufferView": 9, + "componentType": 5126, + "count": 12, + "max": [ + 0, + 0, + 0 + ], + "min": [ + 0, + -1, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 10, + "componentType": 5126, + "count": 12, + "max": [ + 59.8125, + 10.347769737243652, + 53.79964828491211 + ], + "min": [ + 47.09904861450195, + -57.52722930908203, + 26.674650192260742 + ], + "type": "VEC3" + }, + { + "bufferView": 11, + "componentType": 5126, + "count": 12, + "max": [ + 0, + 1, + 1 + ], + "min": [ + 0, + 0, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 12, + "componentType": 5126, + "count": 144, + "max": [ + 145.06260681152344, + 86.40276336669922, + 118.49469757080078 + ], + "min": [ + 93.31257629394531, + 34.65275955200195, + 63.68223190307617 + ], + "type": "VEC3" + }, + { + "bufferView": 13, + "componentType": 5126, + "count": 144, + "max": [ + 0.9057090282440186, + 0.9057090282440186, + 0.4239000082015991 + ], + "min": [ + -0.9057090282440186, + -0.9057090282440186, + 0.4239000082015991 + ], + "type": "VEC3" + }, + { + "bufferView": 14, + "componentType": 5126, + "count": 144, + "max": [ + 124.95549774169922, + 70.41277313232422, + 65.625 + ], + "min": [ + 109.45549774169922, + 54.91276931762695, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 15, + "componentType": 5126, + "count": 144, + "max": [ + 1, + 1, + 0 + ], + "min": [ + -1, + -1, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 16, + "componentType": 5126, + "count": 66, + "max": [ + 124.95549774169922, + 70.41277313232422, + 65.625 + ], + "min": [ + 109.45549774169922, + 54.91276931762695, + 65.625 + ], + "type": "VEC3" + }, + { + "bufferView": 17, + "componentType": 5126, + "count": 66, + "max": [ + 0, + 0, + 1 + ], + "min": [ + 0, + 0, + 1 + ], + "type": "VEC3" + }, + { + "bufferView": 18, + "componentType": 5126, + "count": 66, + "max": [ + 124.95549774169922, + 70.41277313232422, + 0 + ], + "min": [ + 109.45549774169922, + 54.91276931762695, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 19, + "componentType": 5126, + "count": 66, + "max": [ + 0, + 0, + -1 + ], + "min": [ + 0, + 0, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 20, + "componentType": 5126, + "count": 66, + "max": [ + 119.40859985351562, + 60.74879837036133, + 118.49469757080078 + ], + "min": [ + 118.96649932861328, + 60.30672073364258, + 118.49469757080078 + ], + "type": "VEC3" + }, + { + "bufferView": 21, + "componentType": 5126, + "count": 66, + "max": [ + 0, + 0, + 1 + ], + "min": [ + 0, + 0, + 1 + ], + "type": "VEC3" + }, + { + "bufferView": 22, + "componentType": 5126, + "count": 144, + "max": [ + 206.064697265625, + 54.474178314208984, + 118.49469757080078 + ], + "min": [ + 154.314697265625, + 2.724184989929199, + 63.68223190307617 + ], + "type": "VEC3" + }, + { + "bufferView": 23, + "componentType": 5126, + "count": 144, + "max": [ + 0.9057090282440186, + 0.9057090282440186, + 0.4239000082015991 + ], + "min": [ + -0.9057090282440186, + -0.9057090282440186, + 0.4239000082015991 + ], + "type": "VEC3" + }, + { + "bufferView": 24, + "componentType": 5126, + "count": 144, + "max": [ + 185.9575958251953, + 38.48419952392578, + 65.625 + ], + "min": [ + 170.4575958251953, + 22.98419952392578, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 25, + "componentType": 5126, + "count": 144, + "max": [ + 1, + 1, + 0 + ], + "min": [ + -1, + -1, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 26, + "componentType": 5126, + "count": 144, + "max": [ + 203.4501953125, + 148.67950439453125, + 118.49469757080078 + ], + "min": [ + 151.7001953125, + 96.92948150634766, + 63.68223190307617 + ], + "type": "VEC3" + }, + { + "bufferView": 27, + "componentType": 5126, + "count": 144, + "max": [ + 0.9057090282440186, + 0.9057090282440186, + 0.4239000082015991 + ], + "min": [ + -0.9057090282440186, + -0.9057090282440186, + 0.4239000082015991 + ], + "type": "VEC3" + }, + { + "bufferView": 28, + "componentType": 5126, + "count": 144, + "max": [ + 183.34300231933594, + 132.6894989013672, + 65.625 + ], + "min": [ + 167.84300231933594, + 117.18949890136719, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 29, + "componentType": 5126, + "count": 144, + "max": [ + 1, + 1, + 0 + ], + "min": [ + -1, + -1, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 30, + "componentType": 5126, + "count": 90, + "max": [ + 71.375, + 106.25800323486328, + 84.0625 + ], + "min": [ + -82.21044921875, + -170, + 76.125 + ], + "type": "VEC3" + }, + { + "bufferView": 31, + "componentType": 5126, + "count": 90, + "max": [ + 1, + 1, + 1 + ], + "min": [ + -1, + -1, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 32, + "componentType": 5126, + "count": 6, + "max": [ + 59.8125, + 77.99043273925781, + 76.125 + ], + "min": [ + 47.09904861450195, + -143.1345977783203, + 76.125 + ], + "type": "VEC3" + }, + { + "bufferView": 33, + "componentType": 5126, + "count": 6, + "max": [ + 0, + 0, + -1 + ], + "min": [ + 0, + 0, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 34, + "componentType": 5126, + "count": 6, + "max": [ + 47.09904861450195, + 77.99043273925781, + 76.125 + ], + "min": [ + -46.21345138549805, + -143.1345977783203, + 76.125 + ], + "type": "VEC3" + }, + { + "bufferView": 35, + "componentType": 5126, + "count": 6, + "max": [ + 0, + 0, + -1 + ], + "min": [ + 0, + 0, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 36, + "componentType": 5126, + "count": 228, + "max": [ + 989.8612060546875, + 1167.9329833984375, + 0 + ], + "min": [ + -1437.9510498046875, + -656.0665893554688, + 0 + ], + "type": "VEC3" + }, + { + "bufferView": 37, + "componentType": 5126, + "count": 228, + "max": [ + 0, + 0, + 1 + ], + "min": [ + 0, + 0, + -1 + ], + "type": "VEC3" + }, + { + "bufferView": 38, + "componentType": 5123, + "count": 114, + "max": [ + 113 + ], + "min": [ + 0 + ], + "type": "SCALAR" + }, + { + "bufferView": 39, + "componentType": 5123, + "count": 114, + "max": [ + 227 + ], + "min": [ + 114 + ], + "type": "SCALAR" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.9098039215686274, + 0.792156862745098, + 1, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "ground" + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.8, + 0.6, + 1, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "fogless" + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.8823529411764706, + 0.7019607843137254, + 0.8392156862745098, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "fogless" + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.7647058823529411, + 0.6039215686274509, + 0.7764705882352941, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "fogless" + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.2980392, + 0.6, + 0, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "leaves" + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.4235294, + 0.3215686, + 0.2627451, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "trunk" + }, + { + "pbrMetallicRoughness": { + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "fogless" + }, + { + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.8, + 0.6, + 0, + 1 + ], + "metallicFactor": 0.5, + "roughnessFactor": 0.5 + }, + "name": "ground" + } + ], + "meshes": [ + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 0, + "NORMAL": 1 + }, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 2, + "NORMAL": 3 + }, + "material": 1 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 4, + "NORMAL": 5 + }, + "material": 2 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 6, + "NORMAL": 7 + }, + "material": 3 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 8, + "NORMAL": 9 + }, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 10, + "NORMAL": 11 + }, + "material": 2 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 12, + "NORMAL": 13 + }, + "material": 4 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 14, + "NORMAL": 15 + }, + "material": 5 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 16, + "NORMAL": 17 + }, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 18, + "NORMAL": 19 + }, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 20, + "NORMAL": 21 + }, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 22, + "NORMAL": 23 + }, + "material": 4 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 24, + "NORMAL": 25 + }, + "material": 5 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 26, + "NORMAL": 27 + }, + "material": 4 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 28, + "NORMAL": 29 + }, + "material": 5 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 30, + "NORMAL": 31 + }, + "material": 0 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 32, + "NORMAL": 33 + }, + "material": 2 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 34, + "NORMAL": 35 + }, + "material": 6 + } + ] + }, + { + "primitives": [ + { + "mode": 4, + "attributes": { + "POSITION": 36, + "NORMAL": 37 + }, + "indices": 38, + "material": 0 + }, + { + "mode": 4, + "attributes": { + "POSITION": 36, + "NORMAL": 37 + }, + "indices": 39, + "material": 7 + } + ] + } + ] +} \ No newline at end of file
true
Other
mrdoob
three.js
550e4eaeffee1b6dc2025502a18736842f66d2d7.json
add fog article
threejs/lessons/resources/threejs-fog.js
@@ -0,0 +1,55 @@ +'use strict'; + +/* global threejsLessonUtils */ + +{ + function fogExample(scene, fog) { + scene.fog = fog; + const width = 4; + const height = 3; + const depth = 10; + const geometry = new THREE.BoxBufferGeometry(width, height, depth); + const material = new THREE.MeshPhongMaterial({color: 'hsl(130,50%,50%)'}); + return new THREE.Mesh(geometry, material); + } + + threejsLessonUtils.addDiagrams({ + fog: { + create(props) { + const {scene} = props; + const color = 0xFFFFFF; + const near = 12; + const far = 18; + return fogExample(scene, new THREE.Fog(color, near, far)); + }, + }, + fogExp2: { + create(props) { + const {scene} = props; + const color = 0xFFFFFF; + const density = 0.1; + return fogExample(scene, new THREE.FogExp2(color, density)); + }, + }, + fogBlueBackgroundRed: { + create(props) { + const {scene} = props; + scene.background = new THREE.Color('#F00'); + const color = '#00F'; + const near = 12; + const far = 18; + return fogExample(scene, new THREE.Fog(color, near, far)); + }, + }, + fogBlueBackgroundBlue: { + create(props) { + const {scene} = props; + scene.background = new THREE.Color('#00F'); + const color = '#00F'; + const near = 12; + const far = 18; + return fogExample(scene, new THREE.Fog(color, near, far)); + }, + }, + }); +}
true
Other
mrdoob
three.js
550e4eaeffee1b6dc2025502a18736842f66d2d7.json
add fog article
threejs/lessons/threejs-fog.md
@@ -0,0 +1,251 @@ +Title: Three.js Fog +Description: Fog in Three.js + +This article is part of a series of articles about three.js. The +first article is [three.js fundamentals](threejs-fundamentals.html). If +you haven't read that yet and you're new to three.js you might want to +consider starting there. If you haven't read about cameras you might +want to start with [this article](threejs-cameras.html). + +Fog in a 3D engine is generally a way of fading to a specific color +based on the distance from the camera. In three.js you add fog by +creating `Fog` or `FogExp2` object and setting it on the scene's +[`fog`](https://threejs.org/docs/#api/scenes/Scene.fog) property. + +`Fog` lets you choose `near` and `far` settings which are distances +from the camera. Anything closer than `near` is unaffected by fog. +Anything further than `far` is completely the fog color. Parts between +`near` and `far` fade from their material color to the fog color. + +There's also `FogExp2` which grows expotentially with distance from the camera. + +To use either type of fog you create one and and assign it to the scene as in + +``` +const scene = new THREE.Scene(); +{ + const color = 0xFFFFFF; // white + const near = 10; + const far = 100; + scene.fog = new THREE.Fog(color, near, far); +} +``` + +or for `FogExp2` it would be + +``` +const scene = new THREE.Scene(); +{ + const color = 0xFFFFFF; + const density = 0.1; + scene.fog = new THREE.FogExp2(color, density); +} +``` + +`FogExp2` is closer to reality but `Fog` is used +more commonly since it lets you choose a place to apply +the fog so you can decide to show a clear scene +up to a certain distance and then fade out to some color +past that distance. + +<div class="spread"> + <div> + <div data-diagram="fog"></div> + <div class="code">THREE.Fog</div> + </div> + <div> + <div data-diagram="fogExp2"></div> + <div class="code">THREE.FogExp2</div> + </div> +</div> + +It's important to note that the fog is applied to *things that are rendered*. +It is part of the calculation of each pixel of the color of the object. +What that means is if you want your scene to fade to a certain color you +need to set the fog **and** the background color to the same color. +The background color is set using the +[`scene.background`](https://threejs.org/docs/#api/scenes/Scene.background) +property. To pick a background color you attach a `THREE.Color` to it. For example + +``` +scene.background = new THREE.Color('#F00'); // red +``` + +<div class="spread"> + <div> + <div data-diagram="fogBlueBackgroundRed"></div> + <div class="code">fog blue, background red</div> + </div> + <div> + <div data-diagram="fogBlueBackgroundBlue"></div> + <div class="code">fog blue, background blue</div> + </div> +</div> + +Here is one of our previous examples with fog added. The only addition +is right after setting up the scene we add the fog and set the scene's +backgound color + +``` +const scene = new THREE.Scene(); + ++{ ++ const near = 1; ++ const far = 2; ++ const color = 'lightblue'; ++ scene.fog = new THREE.Fog(color, near, far); ++ scene.background = new THREE.Color(color); ++} +``` + +In the example below the camera's `near` is 0.1 and its `far` is 5. +The camera is at `z = 2`. The cubes are 1 unit large and at Z = 0. +This means with a fog setting of `near = 1` and `far = 2` the cubes +will fade out right around their center. + +{{{example url="../threejs-fog.html" }}} + +Let's add an interface so we can adjust the fog. Again we'll use +[dat.GUI](https://github.com/dataarts/dat.gui). dat.GUI takes +an object and a property and automagically makes an interface +for that type of property. We could just simply let it manipulate +the fog's `near` and `far` properties but it's invalid to have +`near` be greater than `far` so let's make a helper so dat.GUI +can manipulate a `near` and `far` property but we'll make sure `near` +is less than or equal to `far` and `far` is greater than or equal `near`. + +``` +// We use this class to pass to dat.gui +// so when it manipulates near or far +// near is never > far and far is never < near +class FogGUIHelper { + constructor(fog) { + this.fog = fog; + } + get near() { + return this.fog.near; + } + set near(v) { + this.fog.near = v; + this.fog.far = Math.max(this.fog.far, v); + } + get far() { + return this.fog.far; + } + set far(v) { + this.fog.far = v; + this.fog.near = Math.min(this.fog.near, v); + } +} +``` + +We can then add it like this + +``` +{ + const near = 1; + const far = 2; + const color = 'lightblue'; + scene.fog = new THREE.Fog(color, near, far); + scene.background = new THREE.Color(color); ++ ++ const fogGUIHelper = new FogGUIHelper(scene.fog); ++ gui.add(fogGUIHelper, 'near', zNear, zFar).listen(); ++ gui.add(fogGUIHelper, 'far', zNear, zFar).listen(); +} +``` + +The `zNear` and `zFar` parameter set the minimum and maximum values +for adjusting the fog. They are set when we setup the camera. + +The `.listen()` at the end of the last 2 lines tells dat.GUI to *listen* +for changes. That way when we change `near` because of an edit to `far` +or we change `far` in response to an edit to `near` dat.GUI will update +the other property's UI for us. + +It might also be nice to be able to change the fog color but like was +mentioned above we need to keep both the fog color and the background +color in sync. So, let's add another *virtual* property to our helper +that will set both colors when dat.GUI manipulates it. + +dat.GUI can manipulate colors in 4 ways, as a CSS 6 digit hex string (eg: `#112233`). As an hue, saturation, value, object (eg: `{h: 60, s: 1, v: }`). +As an RGB array (eg: `[255, 128, 64]`). Or, as an RGBA array (eg: `[127, 200, 75, 0.3]`). + +It's easiest for our purpose to use the hex string version since that way +dat.GUI is only manipulating a single value. Fortunately `THREE.Color` +as a [`getHexString`](https://threejs.org/docs/#api/math/Color.getHexString) method +we get use to easily get such a string, we just have to prepend a '#' to the front. + +``` +// We use this class to pass to dat.gui +// so when it manipulates near or far +// near is never > far and far is never < near ++// Also when dat.gui maniplates color we'll ++// update both the fog and background colors. +class FogGUIHelper { +* constructor(fog, backgroundColor) { + this.fog = fog; ++ this.backgroundColor = backgroundColor; + } + get near() { + return this.fog.near; + } + set near(v) { + this.fog.near = v; + this.fog.far = Math.max(this.fog.far, v); + } + get far() { + return this.fog.far; + } + set far(v) { + this.fog.far = v; + this.fog.near = Math.min(this.fog.near, v); + } ++ get color() { ++ return `#${this.fog.color.getHexString()}`; ++ } ++ set color(hexString) { ++ this.fog.color.set(hexString); ++ this.backgroundColor.set(hexString); ++ } +} +``` + +We then call `gui.addColor` to add a color UI for our helper's virutal property. + +``` +{ + const near = 1; + const far = 2; + const color = 'lightblue'; + scene.fog = new THREE.Fog(color, near, far); + scene.background = new THREE.Color(color); + +* const fogGUIHelper = new FogGUIHelper(scene.fog, scene.background); + gui.add(fogGUIHelper, 'near', zNear, zFar).listen(); + gui.add(fogGUIHelper, 'far', zNear, zFar).listen(); ++ gui.addColor(fogGUIHelper, 'color'); +} +``` + +{{{example url="../threejs-fog-gui.html" }}} + +You can see setting `near` to like 1.9 and `far` to 2.0 gives +a very sharp transition between unfogged and completely fogged. +where as `near` = 1.1 and `far` = 2.9 should just about be +the smoothest given our cubes are spinning 2 units away from the camera. + +One last thing, there is a boolean [`fog`](https://threejs.org/docs/#api/materials/Material.fog) +property on a material for whether or not objects rendered +with that material are affected by fog. It defaults to `true` +for most materials. As an example of why you might want +to turn the fog off, imagine you're making a 3D vehicle +simulator with a view from the driver's seat or cockpit. +You probably want the fog off for everything inside the vehicle when +viewing from inside the vehicle. + +<canvas id="c"></canvas> +<script src="../resources/threejs/r94/three.min.js"></script> +<script src="../resources/threejs/r94/js/controls/TrackballControls.js"></script> +<script src="resources/threejs-lesson-utils.js"></script> +<script src="resources/threejs-fog.js"></script>
true
Other
mrdoob
three.js
550e4eaeffee1b6dc2025502a18736842f66d2d7.json
add fog article
threejs/lessons/toc.html
@@ -6,6 +6,7 @@ <li><a href="/threejs/lessons/threejs-primitives.html">Three.js Primitives</a></li> <li><a href="/threejs/lessons/threejs-scenegraph.html">Three.js Scenegraph</a></li> <li><a href="/threejs/lessons/threejs-materials.html">Three.js Materials</a></li> + <li><a href="/threejs/lessons/threejs-fog.html">Three.js Fog</a></li> </ul> </ul> <ul>
true
Other
mrdoob
three.js
550e4eaeffee1b6dc2025502a18736842f66d2d7.json
add fog article
threejs/threejs-fog-gui.html
@@ -0,0 +1,157 @@ +<!-- Licensed under a BSD license. See license.html for license --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> + <title>Three.js - Fog w/GUI</title> + <style> + body { + margin: 0; + } + #c { + width: 100vw; + height: 100vh; + display: block; + } + </style> + </head> + <body> + <canvas id="c"></canvas> + </body> +<script src="../3rdparty/dat.gui.min.js"></script> +<script src="resources/threejs/r94/three.min.js"></script> +<script> +'use strict'; + +/* global dat */ + +function main() { + const canvas = document.querySelector('#c'); + const renderer = new THREE.WebGLRenderer({canvas: canvas}); + const gui = new dat.GUI(); + + const fov = 75; + const aspect = 2; // the canvas default + const zNear = 0.1; + const zFar = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + camera.position.z = 2; + + const scene = new THREE.Scene(); + + // We use this class to pass to dat.gui + // so when it manipulates near or far + // near is never > far and far is never < near + // Also when dat.gui maniplates color we'll + // update both the fog and background colors. + class FogGUIHelper { + constructor(fog, backgroundColor) { + this.fog = fog; + this.backgroundColor = backgroundColor; + } + get near() { + return this.fog.near; + } + set near(v) { + this.fog.near = v; + this.fog.far = Math.max(this.fog.far, v); + } + get far() { + return this.fog.far; + } + set far(v) { + this.fog.far = v; + this.fog.near = Math.min(this.fog.near, v); + } + get color() { + return `#${this.fog.color.getHexString()}`; + } + set color(hexString) { + this.fog.color.set(hexString); + this.backgroundColor.set(hexString); + } + } + + { + const near = 1; + const far = 2; + const color = 'lightblue'; + scene.fog = new THREE.Fog(color, near, far); + scene.background = new THREE.Color(color); + + const fogGUIHelper = new FogGUIHelper(scene.fog, scene.background); + gui.add(fogGUIHelper, 'near', zNear, zFar).listen(); + gui.add(fogGUIHelper, 'far', zNear, zFar).listen(); + gui.addColor(fogGUIHelper, 'color'); + } + + { + const color = 0xFFFFFF; + const intensity = 1; + const light = new THREE.DirectionalLight(color, intensity); + light.position.set(-1, 2, 4); + scene.add(light); + } + + const boxWidth = 1; + const boxHeight = 1; + const boxDepth = 1; + const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth); + + function makeInstance(geometry, color, x) { + const material = new THREE.MeshPhongMaterial({color}); + + const cube = new THREE.Mesh(geometry, material); + scene.add(cube); + + cube.position.x = x; + + return cube; + } + + const cubes = [ + makeInstance(geometry, 0x44aa88, 0), + makeInstance(geometry, 0x8844aa, -2), + makeInstance(geometry, 0xaa8844, 2), + ]; + + 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; + } + + function render(time) { + time *= 0.001; + + if (resizeRendererToDisplaySize(renderer)) { + const canvas = renderer.domElement; + camera.aspect = canvas.clientWidth / canvas.clientHeight; + camera.updateProjectionMatrix(); + } + + cubes.forEach((cube, ndx) => { + const speed = 1 + ndx * .1; + const rot = time * speed; + cube.rotation.x = rot; + cube.rotation.y = rot; + }); + + renderer.render(scene, camera); + + requestAnimationFrame(render); + } + + requestAnimationFrame(render); +} + +main(); +</script> +</html> +
true
Other
mrdoob
three.js
550e4eaeffee1b6dc2025502a18736842f66d2d7.json
add fog article
threejs/threejs-fog.html
@@ -0,0 +1,115 @@ +<!-- Licensed under a BSD license. See license.html for license --> +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> + <title>Three.js - Fog</title> + <style> + body { + margin: 0; + } + #c { + width: 100vw; + height: 100vh; + display: block; + } + </style> + </head> + <body> + <canvas id="c"></canvas> + </body> +<script src="resources/threejs/r94/three.min.js"></script> +<script> +'use strict'; + +function main() { + const canvas = document.querySelector('#c'); + const renderer = new THREE.WebGLRenderer({canvas: canvas}); + + const fov = 75; + const aspect = 2; // the canvas default + const zNear = 0.1; + const zFar = 5; + const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); + camera.position.z = 2; + + const scene = new THREE.Scene(); + + { + const near = 1; + const far = 2; + const color = 'lightblue'; + scene.fog = new THREE.Fog(color, near, far); + scene.background = new THREE.Color(color); + } + + { + const color = 0xFFFFFF; + const intensity = 1; + const light = new THREE.DirectionalLight(color, intensity); + light.position.set(-1, 2, 4); + scene.add(light); + } + + const boxWidth = 1; + const boxHeight = 1; + const boxDepth = 1; + const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth); + + function makeInstance(geometry, color, x) { + const material = new THREE.MeshPhongMaterial({color}); + + const cube = new THREE.Mesh(geometry, material); + scene.add(cube); + + cube.position.x = x; + + return cube; + } + + const cubes = [ + makeInstance(geometry, 0x44aa88, 0), + makeInstance(geometry, 0x8844aa, -2), + makeInstance(geometry, 0xaa8844, 2), + ]; + + 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; + } + + function render(time) { + time *= 0.001; + + if (resizeRendererToDisplaySize(renderer)) { + const canvas = renderer.domElement; + camera.aspect = canvas.clientWidth / canvas.clientHeight; + camera.updateProjectionMatrix(); + } + + cubes.forEach((cube, ndx) => { + const speed = 1 + ndx * .1; + const rot = time * speed; + cube.rotation.x = rot; + cube.rotation.y = rot; + }); + + renderer.render(scene, camera); + + requestAnimationFrame(render); + } + + requestAnimationFrame(render); +} + +main(); +</script> +</html> +
true
Other
mrdoob
three.js
29dd038c31f03d1d7a51f6a072c571588709e693.json
add materials article
threejs/lessons/resources/threejs-materials.js
@@ -0,0 +1,186 @@ +'use strict'; + +/* global threejsLessonUtils */ + +{ + function smoothOrFlat(flatShading, radius = 7) { + const widthDivisions = 12; + const heightDivisions = 9; + const geometry = new THREE.SphereBufferGeometry(radius, widthDivisions, heightDivisions); + const material = new THREE.MeshPhongMaterial({ + flatShading, + color: 'hsl(300,50%,50%)', + }); + return new THREE.Mesh(geometry, material); + } + + function basicLambertPhongExample(MaterialCtor, lowPoly, params = {}) { + const radius = 7; + const widthDivisions = lowPoly ? 8 : 100; + const heightDivisions = lowPoly ? 5 : 50; + const geometry = new THREE.SphereBufferGeometry(radius, widthDivisions, heightDivisions); + const material = new MaterialCtor(Object.assign({ + color: 'hsl(210,50%,50%)', + }, params)); + return new THREE.Mesh(geometry, material); + } + + function sideExample(side) { + const base = new THREE.Object3D(); + const size = 6; + const geometry = new THREE.PlaneBufferGeometry(size, size); + [ + { position: [ -1, 0, 0], up: [0, 1, 0], }, + { position: [ 1, 0, 0], up: [0, -1, 0], }, + { position: [ 0, -1, 0], up: [0, 0, -1], }, + { position: [ 0, 1, 0], up: [0, 0, 1], }, + { position: [ 0, 0, -1], up: [ 1, 0, 0], }, + { position: [ 0, 0, 1], up: [-1, 0, 0], }, + ].forEach((settings, ndx) => { + const material = new THREE.MeshBasicMaterial({side}); + material.color.setHSL(ndx / 6, .5, .5); + const mesh = new THREE.Mesh(geometry, material); + mesh.up.set(...settings.up); + mesh.lookAt(...settings.position); + mesh.position.set(...settings.position).multiplyScalar(size * .75); + base.add(mesh); + }); + return base; + } + + threejsLessonUtils.addDiagrams({ + smoothShading: { + create() { + return smoothOrFlat(false); + }, + }, + flatShading: { + create() { + return smoothOrFlat(true); + }, + }, + MeshBasicMaterial: { + create() { + return basicLambertPhongExample(THREE.MeshBasicMaterial); + }, + }, + MeshLambertMaterial: { + create() { + return basicLambertPhongExample(THREE.MeshLambertMaterial); + }, + }, + MeshPhongMaterial: { + create() { + return basicLambertPhongExample(THREE.MeshPhongMaterial); + }, + }, + MeshBasicMaterialLowPoly: { + create() { + return basicLambertPhongExample(THREE.MeshBasicMaterial, true); + }, + }, + MeshLambertMaterialLowPoly: { + create() { + return basicLambertPhongExample(THREE.MeshLambertMaterial, true); + }, + }, + MeshPhongMaterialLowPoly: { + create() { + return basicLambertPhongExample(THREE.MeshPhongMaterial, true); + }, + }, + MeshPhongMaterialShininess0: { + create() { + return basicLambertPhongExample(THREE.MeshPhongMaterial, false, { + color: 'red', + shininess: 0, + }); + }, + }, + MeshPhongMaterialShininess30: { + create() { + return basicLambertPhongExample(THREE.MeshPhongMaterial, false, { + color: 'red', + shininess: 30, + }); + }, + }, + MeshPhongMaterialShininess150: { + create() { + return basicLambertPhongExample(THREE.MeshPhongMaterial, false, { + color: 'red', + shininess: 150, + }); + }, + }, + MeshBasicMaterialCompare: { + create() { + return basicLambertPhongExample(THREE.MeshBasicMaterial, false, { + color: 'purple', + }); + }, + }, + MeshLambertMaterialCompare: { + create() { + return basicLambertPhongExample(THREE.MeshLambertMaterial, false, { + color: 'black', + emissive: 'purple', + }); + }, + }, + MeshPhongMaterialCompare: { + create() { + return basicLambertPhongExample(THREE.MeshPhongMaterial, false, { + color: 'black', + emissive: 'purple', + shininess: 0, + }); + }, + }, + MeshToonMaterial: { + create() { + return basicLambertPhongExample(THREE.MeshToonMaterial); + }, + }, + MeshDepthMaterial: { + create(props) { + const {camera} = props; + const radius = 4; + const tube = 1.5; + const radialSegments = 8; + const tubularSegments = 64; + const p = 2; + const q = 3; + const geometry = new THREE.TorusKnotBufferGeometry(radius, tube, tubularSegments, radialSegments, p, q); + const material = new THREE.MeshDepthMaterial(); + camera.near = 7; + camera.far = 20; + return new THREE.Mesh(geometry, material); + }, + }, + MeshNormalMaterial: { + create() { + const radius = 4; + const tube = 1.5; + const radialSegments = 8; + const tubularSegments = 64; + const p = 2; + const q = 3; + const geometry = new THREE.TorusKnotBufferGeometry(radius, tube, tubularSegments, radialSegments, p, q); + const material = new THREE.MeshNormalMaterial(); + return new THREE.Mesh(geometry, material); + }, + }, + sideDefault: { + create() { + return sideExample(THREE.FrontSide); + }, + }, + sideDouble: { + create() { + return sideExample(THREE.DoubleSide); + }, + }, + }); +} +
true
Other
mrdoob
three.js
29dd038c31f03d1d7a51f6a072c571588709e693.json
add materials article
threejs/lessons/threejs-materials-and-lights.md
@@ -1,8 +0,0 @@ -Title: Three.js Materials and Lights -Description: Materials and Lights - -This article is part of a series of articles about three.js. The -first article is [three.js fundamentals](three-fundamentals.html). If -you haven't read yet you might want to consider starting there. - -TBD
true
Other
mrdoob
three.js
29dd038c31f03d1d7a51f6a072c571588709e693.json
add materials article
threejs/lessons/threejs-materials.md
@@ -0,0 +1,276 @@ +Title: Three.js Materials +Description: Materials in Three.js + +This article is part of a series of articles about three.js. The +first article is [three.js fundamentals](three-fundamentals.html). If +you haven't read that yet and you're new to three.js you might want to +consider starting there. + +Three.js provides several types of materials. +They define how objects will appear in the scene. +Which materials you use really depends on what you're trying to +accomplish. + +There are 2 ways to set most material properties. One at creation time which +we've seen before. + +``` +const material = new THREE.MeshPhongMaterial({ + color: 0xFF0000, // red (can also use a CSS color string here) + flatShading: true, +}); +``` + +The other is after creation + +``` +const material = new THREE.MeshPhongMaterial(); +material.color.setHSL(0, 1, .5); // red +material.flatShading = true; +``` + +note that properties of type `THREE.Color` have multiple ways to be set. + +``` +material.color.set(0x00FFFF); // same as CSS's #RRGGBB style +material.color.set(cssString); // any CSS color, eg 'purple', '#F32', + // 'rgb(255, 127, 64)', + // 'hsl(180, 50%, 25%)' +material.color.set(someColor) // some other THREE.Color +material.color.setHSL(h, s, l) // where h, s, and l are 0 to 1 +material.color.setRGB(r, g, b) // where r, g, and b are 0 to 1 +``` + +And at creation time you and pass either a hex number or a CSS string + +``` +const m1 = new THREE.MeshBasicMaterial({color: 0xFF0000}); // red +const m2 = new THREE.MeshBasicMaterial({color: 'red'}); // red +const m3 = new THREE.MeshBasicMaterial({color: '#F00'}); // red +const m4 = new THREE.MeshBasicMaterial({color: 'rgb(255,0,0)'}); // red +const m5 = new THREE.MeshBasicMaterial({color: 'hsl(0,100%,50%)'); // red +``` + +So let's go over three.js's set of materials. + +The `MeshBasicMaterial` is not affected by lights. +The `MeshLambertMaterial` computes lighting only at the vertices vs the `MeshPhongMaterial` which computes lighting at every pixel. The `MeshPhongMaterial` +also supports specular highlights. + +<div class="spread"> + <div> + <div data-diagram="MeshBasicMaterial" ></div> + <div class="code">Basic</div> + </div> + <div> + <div data-diagram="MeshLambertMaterial" ></div> + <div class="code">Lambert</div> + </div> + <div> + <div data-diagram="MeshPhongMaterial" ></div> + <div class="code">Phong</div> + </div> +</div> +<div class="spread"> + <div> + <div data-diagram="MeshBasicMaterialLowPoly" ></div> + </div> + <div> + <div data-diagram="MeshLambertMaterialLowPoly" ></div> + </div> + <div> + <div data-diagram="MeshPhongMaterialLowPoly" ></div> + </div> +</div> +<div class="threejs_center code">low-poly models with same materials</div> + +The `shininess` setting of the `MeshPhongMaterial` determines the *shininess* of the specular highlight. It defaults to 30. + +<div class="spread"> + <div> + <div data-diagram="MeshPhongMaterialShininess0" ></div> + <div class="code">shininess: 0</div> + </div> + <div> + <div data-diagram="MeshPhongMaterialShininess30" ></div> + <div class="code">shininess: 30</div> + </div> + <div> + <div data-diagram="MeshPhongMaterialShininess150" ></div> + <div class="code">shininess: 150</div> + </div> +</div> + +Note that setting the `emissive` property to a color on either a +`MeshLambertMaterial` or a `MeshPhongMaterial` and setting the `color` to black +(and `shininess` to 0 for phong) ends up looking just like the `MeshBasicMaterial`. + +<div class="spread"> + <div> + <div data-diagram="MeshBasicMaterialCompare" ></div> + <div class="code"> + <div>Basic</div> + <div>color: 'purple'</div> + </div> + </div> + <div> + <div data-diagram="MeshLambertMaterialCompare" ></div> + <div class="code"> + <div>Lambert</div> + <div>color: 'black'</div> + <div>emissive: 'purple'</div> + </div> + </div> + <div> + <div data-diagram="MeshPhongMaterialCompare" ></div> + <div class="code"> + <div>Phong</div> + <div>color: 'black'</div> + <div>emissive: 'purple'</div> + <div>shininess: 0</div> + </div> + </div> +</div> + +Why have all 3 when `MeshPhongMaterial` can do the same things as `MeshBasicMaterial` +and `MeshLambertMaterial`? The reason is the more sophisticated material +takes more GPU power to draw. On a slower GPU like say a mobile phone +you might want to reduce the GPU power needed to draw your scene by +using one of the less complex materials. It also follows that if you +don't need the extra features then use the simplest material. If you don't +need the lighting and the specular highlight then use the `MeshBasicMaterial`. + +The `MeshToonMaterial` is similar to the `MeshPhongMaterial` +with one big difference. Rather than shading smoothly it uses a gradient map +(an X by 1 texture) to decide how to shade. The default uses a gradient map +that is 70% brightness for the first 70% and 100% after but you can supply your +own gradient map. This ends up giving a 2 tone look that looks like a cartoon. + +<div class="spread"> + <div data-diagram="MeshToonMaterial"></div> +</div> + +There are 3 materials that have special uses. `ShadowMaterial` +is used to get the data created from shadows. We haven't +covered shadows yet. When we do we'll use this material +to take a peak at what's happening behind the scenes. + +The `MeshDepthMaterial` renders the depth of each pixel where +pixels at negative [`near`](https://threejs.org/docs/#api/cameras/PerspectiveCamera.near) of the camera are 0 and negative [`far`](https://threejs.org/docs/#api/cameras/PerspectiveCamera.far) are 1. Certain special effects can use this data which we'll +get into at another time. + +<div class="spread"> + <div> + <div data-diagram="MeshDepthMaterial"></div> + </div> +</div> + +The `MeshNormalMaterial` will show you the *normals* of geometry. +*Normals* are the direction a particular triangle or pixel faces. +`MeshNormalMaterial` draws the view space normals. (the normals relative to the camera). +<span class="color:red;">x is red</span>, +<span class="color:green;">y is green</span>, and +<span class="color:blue;">z is blue</span> so things facing +to the right will be red, up will be green, and toward the screen will be blue. + +<div class="spread"> + <div> + <div data-diagram="MeshNormalMaterial"></div> + </div> +</div> + +`ShaderMaterial` is for making custom materials using three.js shader +system. `RawShaderMaterial` is for making entirely custom shaders with +no help from three.js. Both of these topics are large and will be +covered later. + +The last 2 materials we'll metion here are the `MeshStandardMaterial` +and the `MeshPhysicsMaterial`. Both implement what's called *physically +based rendering* or often PBR for short. This is a way of computing +material properties and lights that comes close to the way +lights and materials work in the real word. We'll cover these in +more detail in another article. + +Most materials share a bunch of settings all defined by `Material`. +[See the docs](https://threejs.org/docs/#api/materials/Material) +for all of them but let's go over two of the most commonly used +properties. + +[`flatShading`](https://threejs.org/docs/#api/materials/Material.flatShading): +whether or not the object looks faceted or smooth. default = `false`. + +<div class="spread"> + <div> + <div data-diagram="smoothShading"></div> + <div class="code">flatShading: false</div> + </div> + <div> + <div data-diagram="flatShading"></div> + <div class="code">flatShading: true</div> + </div> +</div> + +[`side`](https://threejs.org/docs/#api/materials/Material.side): which sides of triangles to show. The default is `THREE.FrontSide`. +Other options are `THREE.BackSide` and `THREE.DoubleSide` (both sides). +Most 3D objects drawn in three are probably opaque solids so the back sides +(the sides facing inside the solid) do not need to be drawn. The most common +reason to set `side` is for planes or other non-solid objects where it is +common to see the back sides of triangles. + +Here are 6 planes drawn with `THREE.FrontSide` and `THREE.DoubleSide`. + +<div class="spread"> + <div> + <div data-diagram="sideDefault" style="height: 250px;"></div> + <div class="code">side: THREE.FrontSide</div> + </div> + <div> + <div data-diagram="sideDouble" style="height: 250px;"></div> + <div class="code">side: THREE.DoubleSide</div> + </div> +</div> + +There's really a lot to consider with materials and we actually still +have a bunch more to go. In particlar we've mostly ignored textures +which open up a whole slew of options. Before we cover textures though +we need to take a break and cover +[setting up your development environment](threejs-setup.html) + +<div class="threejs_bottombar"> +<h3>material.needsUpdate</h3> +<p> +This topic rarely affects most three.js apps but just as an FYI... +Three.js applies material settings when a material is used where "used" +means "something is rendered that uses the material". Some material settings are +only applied once as changing them requires lots of work by three.js. +In those cases you need to set <code>material.needsUpdate = true</code> to tell +three.js to apply your material changes. The most common settings +that require you to set <code>needsUpdate</code> if you change the settings after +using the material are: +</p> +<ul> + <li><code>flatShading</code></li> + <li>adding or removing a texture. + <p> + Changing a texture is ok, but if want switch from using no texture + to using a texture or from using a texture to using no texture + then you need to set <code>needsUpdate = true</code>. + </p> + <p>In the case of going from texture to no-texture it is often + just better to use a 1x1 pixel white texture.</p> + </li> +</ul> +<p>As mentioned above most apps never run into these issues. Most apps +do not switch between flat shaded and non flat shaded. Most apps also +either use textures or a solid color for a given material, they rarely +switch from using one to using the other. +</p> +</div> + +<canvas id="c"></canvas> +<script src="../resources/threejs/r94/three.min.js"></script> +<script src="../resources/threejs/r94/js/controls/TrackballControls.js"></script> +<script src="resources/threejs-lesson-utils.js"></script> +<script src="resources/threejs-materials.js"></script> + +
true
Other
mrdoob
three.js
29dd038c31f03d1d7a51f6a072c571588709e693.json
add materials article
threejs/lessons/toc.html
@@ -5,6 +5,7 @@ <li><a href="/threejs/lessons/threejs-responsive.html">Three.js Responsive Design</a></li> <li><a href="/threejs/lessons/threejs-primitives.html">Three.js Primitives</a></li> <li><a href="/threejs/lessons/threejs-scenegraph.html">Three.js Scenegraph</a></li> + <li><a href="/threejs/lessons/threejs-materials.html">Three.js Materials</a></li> </ul> </ul> <ul>
true
Other
mrdoob
three.js
b9c1b91986c63da43a3e0c4e5914dee3ce9d22d2.json
remove placeholder page
index.html
@@ -1,31 +0,0 @@ -<style> -* { - box-sizing: border-box; - -moz-box-sizing: border-box; -} -body { - margin: 0; - font-family: sans-serif; - font-weight: bold; - color: white; - background-color: blue; -} -#page { - width: 100vw; - height: 100vh; - display: flex; - justify-content: center; - align-content: center; - align-items: center; -} -#page>h1 { - font-size: 5vh; - flex: 1 1 auto; - text-align: center; -} -</style> -<div id="page"> -<h1>...coming soon...</h1> -</div> - -
false
Other
mrdoob
three.js
cf6b82e0925e2795193a4e001b1cc947d26aea7b.json
add first 4 articles
threejs/lessons/threejs-fundamentals.md
@@ -0,0 +1,316 @@ +Title: Three.js Fundamentals +Description: Your first Three.js lesson starting with the fundamentals + +This is the first article in a series of articles about three.js. +[Three.js](http://threejs.org) is a 3D library that tries to make +it as easy as possible to get 3D content on a webpage. + +Three.js is often confused with WebGL since more often than +not, but not always, three.js uses WebGL to draw 3D. +WebGL is a very low-level +system that only draws points, lines, and triangles. To do +anything useful with WebGL generally requires quite a bit of +code and that is where three.js comes in. It handlings things +like scenes, lights, shadows, materials, textures, all things that you'd +have to write yourself if you were to use WebGL directly. + +These tutorials assume you already know JavaScript and, for the +most part they will use ES6 style JavaScript. Most browsers +that support three.js are auto-updated so most users should +be able to run this code. If you'd like to make this code run +on older browsers look into a transpiler like [Babel](http://babel.io). + +When learning most programming languages the first thing people +do is make the computer print `"Hello World!"`. For 3D one +of the most common first things to do is to make a 3D cube. +so let's start with "Hello Cube!" + +The first thing we need is a `<canvas>` tag so + +``` +<body> + <canvas id="c"></canvas> +</body> +``` + +Three.js will draw into that canvas so we need to look it up +and pass it to three.js. + +``` +<script> +'use strict'; + +function main() { + const canvas = document.querySelector('#c'); + const renderer = new THREE.WebGLRenderer({canvas: canvas}); + ... +</script> +``` + +Note there are some esoteric details here. If you don't pass a canvas +into three.js it will create one for you but then you have to add it +to your document. Where to add it may change depending on your use case +and you'll have to change your code so I find that passing a canvas +to three.js feels a little more flexible. I can put the canvas anywhere +and the code will find it where as if I had code to insert the canvas +into to the document I'd likely have to change that code if my use case +changed. + +After we look up the canvas we create a `WebGLRenderer`. The renderer +is the thing responsible for actually taking all the data you provide +and rendering it to the canvas. In the past there have been other renderers +like `CSSRenderer`, a `CanvasRenderer` and in the future there may be a +`WebGL2Renderer` or `WebGPURenderer`. For now there's the `WebGLRenderer` +that uses WebGL to render 3D to the canvas. + +Next up we need a camera. + +``` +const fov = 75; +const aspect = 2; // the canvas default +const zNear = 0.1; +const zFar = 5; +const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +``` + +`fov` is short for `field of view`. In this case 75 degrees in the vertical +dimension. Note that most angles in three.js are in radians but for some +reason the perspective camera takes degrees. + +`aspect` is the display aspect of the canvas. We'll go over the details +in another article but by default a canvas is 300x150 pixels which makes +the aspect 300/150 or 2. + +`zNear` and `zFar` represent the space in front of the camera +that will be rendered. Anything before that range or after that range +will be clipped (not drawn). + +Those 4 settings define a *"frustum"*. A *frustum* is the name of +a 3d shape that is like a pyramid with the tip sliced off. In other +words think of the word "frustum" as another 3D shape like sphere, +cube, prism, frustum. + +<img src="resources/frustum-3d.svg" width="500" class="threejs_center"/> + +The height of the zNear and zFar planes are determined by the field of view. +The width of both planes is determined by the field of view and the aspect. + +Anything inside the defined frustum will be be drawn. Anything outside +will not. + +The camera defaults to looking down the -Z axis with +Y up. We'll put our cube +at the origin so we need to move the camera back a litte from the origin +in order to see anything. + +``` +camera.position.z = 2; +``` + +Here's what we're aiming for. + +<img src="resources/scene-down.svg" width="500" class="threejs_center"/> + +In the diagram above we can see our camera is at `z = 2`. It's looking +down the -Z axis. Our frustum starts 0.1 units from the front of the camera +and goes to 5 units in front of the camera. Because in this diagram we are looking down, +the field of view is affected by the aspect. Our canvas is twice as wide +as it is tall so across view the field of view will be much wider than +our specified 75 degrees which is the vertical field of view. + +Next we make a `Scene`. A `Scene` in three.js is a form of scene graph. +Anything you want three.js to draw needs to be added to the scene. We'll +cover more details of how scenes work in a future article. + +``` +const scene = new THREE.Scene(); +``` + +Next up we create a `BoxGeometry` which contains the data for a box. +Almost anything we want to display in Three.js needs geometry which defines +the vertices that make up our 3D object. + +``` +const boxWidth = 1; +const boxHeight = 1; +const boxDepth = 1; +const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth); +``` + +We then create a basic material and set its color. Colors can +be specified using standard CSS style 6 digit hex color values. + +``` +const material = new THREE.MeshBasicMaterial({color: 0x44aa88}); +``` + +We then create a `Mesh`. A `Mesh` in three represents the combination +of a `Geometry` (the shape of the object) and a `Material` (how to draw +the object, shiny or flat, what color, what texture(s) to apply. Etc.) +as well as the position, orientation, and scale of that +object in the scene. + +``` +const cube = new THREE.Mesh(geometry, material); +``` + +And finally we add that mesh to the scene + +``` +scene.add(cube); +``` + +We can then render the scene by calling the renderer's render function +and passing it the scene and the camera + +``` +renderer.render(scene, camera); +``` + +Here's a working exmaple + +{{{example url="../threejs-fundamentals.html" }}} + +It's kind of hard to tell that is a 3D cube since we're viewing +it directly down the -Z axis and the cube itself is axis aligned +so we're only seeing a single face. + +Let's animate it spinning and hopefully that will make +it clear it's being drawn in 3D. To animate it we'll render inside a render loop using +[`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame). + +Here's our loop + +``` +function render(time) { + time *= 0.001; // convert time to seconds + + cube.rotation.x = time; + cube.rotation.y = time; + + renderer.render(scene, camera); + + requestAnimationFrame(render); +} +requestAnimationFrame(render); +``` + +`requestAnimationFrame` is a request to the browser that you want to animate something. +You pass it a function to be called. In our case that function is `render`. The browser +will call your function and if you update anything related to the display of the +page the browser will re-render the page. In our case we are calling three's +`renderer.render` function which will draw our scene. + +`requestAnimationFrame` passes the time since the page started rendering to +the our function. That time is passed in milliseconds. I find it's much +easier to work with seconds so here we're converting that to seconds. + +We then set the cube's X and Y rotation to the current time. These rotations +are in [radians](https://en.wikipedia.org/wiki/Radian). There are 2 pi radians +in a circle so our cube should turn around once on each axis in about 6.28 +seconds. + +We then render the scene and request another animation frame to continue +our loop. + +Outside the loop we call `requestAnimationFrame` one time to start the loop. + +{{{example url="../threejs-fundamentals-with-animation.html" }}} + +It's a little better but it's still hard to see the 3d. What would help is to add some lighting +so let's add a light. There are many kinds of lights in 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 light = new THREE.DirectionalLight(color, intensity); + light.position.set(-1, 2, 4); + scene.add(light); +} +``` + +Directional lights have a position and a target. Both default to 0, 0, 0. In our +case we're setting the light's position to -1, 2, 4 so it's slightly on the left, +above, and behind our camera. The target is still 0, 0, 0 so it will shine +toward the origin. + +We also need to change the material. The `MeshBasicMaterial` is not affected by +lights. Let's change it to a `MeshPhongMaterial` which is affected by lights. + +``` +-const material = new THREE.MeshBasicMaterial({color: 0x44aa88}); // greenish blue ++const material = new THREE.MeshPhongMaterial({color: 0x44aa88}); // greenish blue +``` + +And here it is working. + +{{{example url="../threejs-fundamentals-with-light.html" }}} + +It should now be pretty clearly 3D. + +Just for the fun of it let's add 2 more cubes. + +We'll use the same geometry for each cube but make a different +material so each cube can be a different color. + +First we'll make a function that creates a new material +with the specified color. Then it creates a mesh using +the specified geometry and adds it to the scene and +sets its X position. + +``` +function makeInstance(geometry, color, x) { + const material = new THREE.MeshPhongMaterial({color}); + + const cube = new THREE.Mesh(geometry, material); + scene.add(cube); + + cube.position.x = x; + + return cube; +} +``` + +Then we'll call it 3 times with 3 different colors and X positions +saving the `Mesh` instances in an array. + +``` +const cubes = [ + makeInstance(geometry, 0x44aa88, 0), + makeInstance(geometry, 0x8844aa, -2), + makeInstance(geometry, 0xaa8844, 2), +]; +``` + +Finally we'll spin all 3 cubes in our render function. We +compute a slightly different rotation for each one. + +``` +function render(time) { + time *= 0.001; // convert time to seconds + + cubes.forEach((cube, ndx) => { + const speed = 1 + ndx * .1; + const rot = time * speed; + cube.rotation.x = rot; + cube.rotation.y = rot; + }); + + ... +``` + +and here's that. + +{{{example url="../threejs-fundamentals-3-cubes.html" }}} + +If you compare it to the top down diagram above you can see +it matches our expectections. With cubes at X = -2 and X = +2 +they are partially outside our frustum. They are also +somewhat exaggeratedly warped since the field of view +across the canvas is so extreme. + +I hope this short intro helps to get things started. [Next up we'll cover +making our code responsive so it is adaptable to multiple situations](threejs-responsive.html). +
true
Other
mrdoob
three.js
cf6b82e0925e2795193a4e001b1cc947d26aea7b.json
add first 4 articles
threejs/lessons/threejs-materials-and-lights.md
@@ -0,0 +1,8 @@ +Title: Three.js Materials and Lights +Description: Materials and Lights + +This article is part of a series of articles about three.js. The +first article is [three.js fundamentals](three-fundamentals.html). If +you haven't read yet you might want to consider starting there. + +TBD
true
Other
mrdoob
three.js
cf6b82e0925e2795193a4e001b1cc947d26aea7b.json
add first 4 articles
threejs/lessons/threejs-primitives.md
@@ -0,0 +1,394 @@ +Title: Three.js Primitives +Description: A tour of three.js primitives. + +This article one in a series of articles about three.js. +The first article was [about fundamentals](threejs-fundamentals.html). +If you haven't read that yet you might want to start there. + +Three.js has a large number of primitives. Primitives +are generally 3D shapes that are generated at runtime +with a bunch of parameters. + +It's common to use primitives for things like a sphere +for globe or a bunch of boxes to draw a 3D graph. It's +especially common to use primitives to experiment +and get started with 3D. For the majority if 3D apps +it's more common to have an artist make 3D models +in a 3D modeling program. Later in this series we'll +cover making and loading data from several 3D modeling +programs. For now let's go over some of the available +primitives. + +<div class="primitives"> +<div data-primitive="BoxBufferGeometry">A Box</div> +<div data-primitive="CircleBufferGeometry">A flat circle</div> +<div data-primitive="ConeBufferGeometry">A Cone</div> +<div data-primitive="CylinderBufferGeometry">A Cylinder</div> +<div data-primitive="DodecahedronBufferGeometry">A dodecahedron (12 sides)</div> +<div data-primitive="ExtrudeBufferGeometry">An extruded 2d shape with optional bevelling. +Here we are extruding a heart shape. Note this is the basis +for <code>TextBufferGeometry</code> and <code>TextGeometry</code> respectively.</div> +<div data-primitive="IcosahedronBufferGeometry">An icosahedron (20 sides)</div> +<div data-primitive="LatheBufferGeometry">A shape generated by spinning a line. Examples would lamps, bowling pins, candles, candle holders, wine glasses, drinking glasses, etc... You provide the 2d silhouette as series of points and then tell three.js how many subdivisions to make as it spins the silhouette around an axis.</div> +<div data-primitive="OctahedronBufferGeometry">An Octahedron (8 sides)</div> +<div data-primitive="ParametricBufferGeometry">A surface generated by providing a function that takes a 2d point from a grid and returns the corresponding 3d point.</div> +<div data-primitive="PlaneBufferGeometry">A 2D plane</div> +<div data-primitive="PolyhedronBufferGeometry">Takes a set of triangles centered around a point and projects them onto a sphere</div> +<div data-primitive="RingBufferGeometry">A 2D disc with a hole in the center</div> +<div data-primitive="ShapeBufferGeometry">A 2d outline that gets trianglulated</div> +<div data-primitive="SphereBufferGeometry">A sphere</div> +<div data-primitive="TetrahedronBufferGeometry">A terahedron (4 sides)</div> +<div data-primitive="TextBufferGeometry">3D Text generated from a 3D font and a string</div> +<div data-primitive="TorusBufferGeometry">A torus (donut)</div> +<div data-primitive="TorusKnotBufferGeometry">A torus knot</div> +<div data-primitive="TubeBufferGeometry">A circle traced down a path</div> +<div data-primitive="EdgesGeometry">A helper object that takes another geometry as input and generates edges only if the angle between faces is greater than some threshold. For example if you look at the box at the top it shows a line going through each face showing every triangle that makes the box. Using an EdgesGeometry instead the middle lines are removed.</div> +<div data-primitive="WireframeGeometry">Generates geometry that contains one line segment (2 points) per edge in the given geometry. With out this you'd often be missing edges or get extra edges since WebGL generally requires 2 points per line segment. For example if all you had was a single triangle there would only be 3 points. If you tried to draw it using a material with <code>wireframe: true</code> you would only get a single line. Passing that triangle geometry to a <code>WireframeGeometry</code> will generate a new Geometry that has 3 lines segments using 6 points..</div> +</div> + +You might notice of most of them come in pairs of `Geometry` +or `BufferGeometry`. The difference between the 2 types is effectively flexibility +vs performance. + +`BufferGeometry` based primitves are the performance oriented +types. The vertices for the geometry are generated directly +into an efficient typed array format ready to be uploaded to the GPU +for rendering. This means they are faster to start up +and take less memory but if you want to modify their +data they take what is often considered more complex +programming to manipulate. + +`Geometry` based primitives are the more flexible, easier to manipulate +type. They are built from JavaScript based classes like `Vector3` for +3D points, `Face3` for triangles. +They take quite a bit of memory and before they can be rendered three.js will need to +convert them to something similar to the corresponding `BufferGeometry` representation. + +If you know you are not going to manipulate a primitive or +if you're comfortable doing the math to manipulate their +internals then it's best to go with the `BufferGeometry` +based primitives. If on the other hand you want to change +a few things before rendering you might find the `Geometry` +based primitives easier to deal with. + +As an simple example a `BufferGeometry` +can not have new vertices easily added. The number of vertices used is +decided at creation time, storage is created, and then data for vertices +are filled in. Where as for `Geometry` you can add vertices as you go. + +We'll go over creating custom geometry in another article. For now +let's make an example creating each type of primitive. We'll start +with the [examples from the previous article](threejs-responsive.html). + +Near the top let's set a background color + +``` +const canvas = document.querySelector('#c'); +const renderer = new THREE.WebGLRenderer({canvas: canvas}); ++renderer.setClearColor(0xAAAAAA); +``` + +This tells three.js to clear to lightish gray. + +The camera needs to change position so that we can see all the +objects. + +``` +-const fov = 75; ++const fov = 40; +const aspect = 2; // the canvas default +const zNear = 0.1; +-const zFar = 5; ++const zFar = 1000; +const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +-camera.position.z = 2; ++camera.position.z = 120; +``` + +Let's add a function, `addObject`, that takes an x, y position and an `Object3D` and adds +the object to the scene. + +``` +const objects = []; +const spread = 15; + +function addObject(x, y, obj) { + obj.position.x = x * spread; + obj.position.y = y * spread; + + scene.add(obj); + objects.push(obj); +} +``` + +Let's also make a function to create a random colored material. +We'll use a feature of `Color` that lets you set a color +based on hue, saturation, and luminance. + +`hue` goes from 0 to 1 around the color wheel with +red at 0, green at .33 and blue at .66. `saturation` +goes from 0 to 1 with 0 having no color and 1 being +most saturated. `luminance` goes from 0 to 1 +with 0 being black, 1 being white and 0.5 being +the maximum amount of color. In other words +as `luminance` goes from 0.0 to 0.5 the color +will go from black to `hue`. From 0.5 to 1.0 +the color will go from `hue` to white. + +``` +function createMaterial() { + const material = new THREE.MeshPhongMaterial({ + side: THREE.DoubleSide, + }); + + const hue = Math.random(); + const saturation = 1; + const luminance = .5; + material.color.setHSL(hue, saturation, luminance); + + return material; +} +``` + +We also passed `side: THREE.DoubleSide` to the material. +This tells three to draw both sides of the triangles +that make up a shape. For a solid shape like a sphere +or a cube there's usually no reason to draw the +back sides of triangles as they all face inside the +shape. In our case though we are drawing a few things +like the `PlaneBufferGeometry` and the `ShapeBufferGeometry` +which are 2 dimensional and so have no inside. Without +setting `side: THREE.DoubleSide` they would disappear +when looking at their back sides. + +I should note that it's faster to draw when **not** setting +`side: THREE.DoubleSide` so ideally we'd set it only on +the materials that really need it but in this case we +are not drawing too much so there isn't much reason to +worry about it. + +Let's make a function, `addSolidGeometry`, that +we pass a geometry and it creates a random colored +material via `createMaterial` and adds it to the scene +via `addObject`. + +``` +function addSolidGeometry(x, y, geometry) { + const mesh = new THREE.Mesh(geometry, createMaterial()); + addObject(x, y, mesh); +} +``` + +Now we can use this for the majority of the primitves we create. +For example creating a box + +``` +{ + const width = 8; + const height = 8; + const depth = 8; + addSolidGeometry(-2, -2, new THREE.BoxBufferGeometry(width, height, depth)); +} +``` + +If you look in the code below you'll see a similar section for each type of geometry. + +Here's the result: + +{{{example url="../threejs-primitives.html" }}} + +There are a couple of notable exceptions to the pattern above. +The biggest is probably the `TextBufferGeometry`. It needs to load +3D font data before it can generate a mesh for the text. +That data loads asynchronously so we need to wait for it +to load before trying to create the geometry. You can see below +we create a `FontLoader` and pass it the url to our font +and a callback. The callback is called after the font loads. +In the callback we create the geometry +and call `addObject` to add it the scene. + +``` +{ + const loader = new THREE.FontLoader(); + loader.load('resources/threejs/fonts/helvetiker_regular.typeface.json', (font) => { + const geometry = new THREE.TextBufferGeometry('three.js', { + font: font, + size: 3.0, + height: .2, + curveSegments: 12, + bevelEnabled: true, + bevelThickness: 0.15, + bevelSize: .3, + bevelSegments: 5, + }); + const mesh = new THREE.Mesh(geometry, createMaterial()); + geometry.computeBoundingBox(); + geometry.boundingBox.getCenter(mesh.position).multiplyScalar(-1); + + const parent = new THREE.Object3D(); + parent.add(mesh); + + addObject(-1, 1, parent); + }); +} +``` + +There's one other difference. We want to spin the text around its +center but by default three.js creates the text such that its center of rotation +is on the left edge. To work around this we can ask three.js to compute the bounding +box of the geometry. We can then call the `getCenter` method +of the bounding box and pass it our mesh's position object. +`getCenter` copies the center of the box into the position. +It also returns the position object so we can call `multiplyScaler(-1)` +to position the entire object such that its center of rotation +is at the center of the object. + +If we then just called `addSolidGeometry` like with previous +examples it would set the position again which is +no good. So, in this case we create an `Object3D` which +is the standard node for the three.js scene graph. `Mesh` +is inherited from `Object3D` as well. We'll cover [how the scene graph +works in another article](threejs-scenegraph.html). +For now it's enough to know that +like DOM nodes, children are drawn relative to their parent. +By making an `Object3D` and making our mesh a child of that +we can position the `Object3D` where ever we want and still +keep the center offset we set earilier. + +If we didn't do this the text would spin off center. + +{{{example url="../threejs-primitives-text.html" }}} + +Notice the one on the left is not spinning around its center +where as the one on the right is. + +The other exceptions are the 2 line based examples for `EdgesGeometry` +and `WireframeGeometry`. Instead of calling `addSolidGeometry` they call +`addLineGeomtry` which looks like this + +``` +function addLineGeometry(x, y, geometry) { + const material = new THREE.LineBasicMaterial({color: 0x000000}); + const mesh = new THREE.LineSegments(geometry, material); + addObject(x, y, mesh); +} +``` + +It creates a black `LineBasicMaterial` and then creates a `LineSegments` +object which is a wrapper for `Mesh` that helps three know you're rendering +line segments (2 points per segment). + +Each of the primitives has several parameters you can pass on creation +and it's best to [look in the documentation](https://threejs.org/docs/) for all of them rather than +repeat them here. You can also click the links above next to each shape +to take you directly to the docs for that shape. + +One other thing that's important to cover is that almost all shapes +have various settings for how much to subdivde them. A good example +might be the sphere geometries. Spheres take parameters for +how many divisions to make around and how many top to bottom. For example + +<div class="spread"> +<div data-primitive-diagram="SphereBufferGeometryLow"></div> +<div data-primitive-diagram="SphereBufferGeometryMedium"></div> +<div data-primitive-diagram="SphereBufferGeometryHigh"></div> +</div> + +The first sphere has 5 segments around and 3 high which is 15 segments +or 30 triangles. The second sphere has 24 segments by 10. That's 240 segments +or 480 triangles. The last one has 50 by 50 which is 2500 segments or 5000 triangles. + +It's up to you to decide how many subdivisions you need. It might +look like you need a high number of segments but remove the lines +and the flat shading and we get this + +<div class="spread"> +<div data-primitive-diagram="SphereBufferGeometryLowSmooth"></div> +<div data-primitive-diagram="SphereBufferGeometryMediumSmooth"></div> +<div data-primitive-diagram="SphereBufferGeometryHighSmooth"></div> +</div> + +It's now not so clear that the one on the right with 5000 triangles +is entirely better than the one in the middle with only 480. +If you're only drawing a few spheres, like say a single globe for +a map of the earth, then a single 10000 triangle sphere is not a bad +choice. If on the otherhand you're trying to draw 1000 spheres +then 1000 spheres times 10000 triangles each is 10 million triangles. +To animate smoothly you need the browser to draw at 60 frames a +second so you'd be asking the browser to draw 600 million triangles +per second. That's a lot of computing. + +Sometimes it's easy to choose. For example you can also choose +to subdivide a plane. + +<div class="spread"> +<div data-primitive-diagram="PlaneBufferGeometryLow"></div> +<div data-primitive-diagram="PlaneBufferGeometryHigh"></div> +</div> + +The plane on the left is 2 triangles. The plane on the right +is 200 triangles. Unlike the sphere there is really no trade off in quality for most +use cases of a plane. You'd most likely only subdivide a plane +if you expected to want to modify or warp it in some way. A box +is similar. + +So, choose whatever is appropriate for your situation. The less +subdivisions you choose the more likely things will run smoothly and the less +memory they'll take. You'll have to decide for yourself what the correct +tradeoff is for your particular siutation. + +Next up let's go over [how three's scene graph works and how +to use it](threejs-scenegraph.html). + +<canvas id="c"></canvas> +<script src="../resources/threejs/r94/three.min.js"></script> +<script src="../resources/threejs/r94/js/controls/TrackballControls.js"></script> +<script src="resources/threejs-primitives.js"></script> +<style> +.spread { + display: flex; +} +.spread>div { + flex: 1 1 auto; + height: 150px; +} +.primitives { +} +.primitives>div { + display: flex; + align-items: center; + margin-bottom: 1em; +} +.primitives .shape { + flex: 0 0 auto; + width: 200px; + height: 200px; +} +.primitives .desc { + word-wrap: break-word; + padding: 1em; + min-width: 0; +} +.primitives .desc code { + white-space: normal; +} +@media (max-width: 550px) { + .primitives .shape { + width: 120px; + height: 120px; + } +} +.primitives .desc { + flex: 1 1 auto; +} +#c { + position: absolute; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: -100; +} +</style> + +
true
Other
mrdoob
three.js
cf6b82e0925e2795193a4e001b1cc947d26aea7b.json
add first 4 articles
threejs/lessons/threejs-responsive.md
@@ -0,0 +1,271 @@ +Title: Three.js Responsive Design +Description: How to make your three.js fit different sized displays. + +This is the second article in a series of articles about three.js. +The first article was [about fundamentals](threejs-fundamentals.html). +If you haven't read that yet you might want to start there. + +This article is about how to make your three.js app be responsive +to any situation. Making a webpage responsive generally refers +to the page displaying well on different sized displays from +desktops to tablets to phones. + +For three.js there are even more situations to consider. For +example a 3D editor with controls on the left, right, top, or +bottom is something we might want to handle. A live diagram +in the middle of a document is another example. + +The last sample we had used a plain canvas with no css and +no size + +``` +<canvas id="c"></canvas> +``` + +That canvas defaults to 300x150 css pixels in size. + +In the web platform the recommended way to set the size +of something is to use CSS. + +Let's make the canvas fill the page by adding CSS + +``` +<style> +html, body { + margin: 0; + height: 100%; +} +#c { + width: 100%; + height: 100%; + display: block; +} +</style> +``` + +In HTML the body has a margin of 5px pixels by default so setting the +margin to 0 removes the margin. Setting the html and body height to 100% +makes them fill the window. Otherwise they are only as large +as the content that fills them. + +Next we tell the `id=c` element to be +100% the size of its container which in this case is the body of +the document. + +Finally we set its `display` mode to `block`. A canvas's +default display mode is `inline`. Inline +elements can end up adding whitespace to what is displayed. By +setting the canvas to `block` that issue goes away. + +Here's the result + +{{{example url="../threejs-responsive-no-resize.html" }}} + +You can see the canvas is now filling the page but there are 2 +problems. One our cubes are stretched. They are not cubes they +are more like boxes. Too tall or too wide. Open the +example in its own window and resize it. You'll see how +the cubes get stretched wide and tall. + +<img src="resources/images/resize-incorrect-aspect.png" width="407" class="threejs_center"> + +The second problem is they look low resolution or blocky and +blurry. Stretch the window really large and you'll really see +the issue. + +<img src="resources/images/resize-low-res.png" class="threejs_center"> + +Let's fix the stretchy problem first. To do that we need +to set the aspect of the camera to the aspect of the canvas's +display size. We can do that by looking at the canvas's +`clientWidth` and `clientHeight` properties. + +We'll update our render loop like this + +``` +function render(time) { + time *= 0.001; + ++ const canvas = renderer.domElement; ++ camera.aspect = client.clientWidth / client.clientHeight; ++ camera.updateProjectionMatrix(); + + ... +``` + +Now the cubes should stop being distorted. + +{{{example url="../threejs-responsive-update-camera.html" }}} + +Open the example in a separate window and resize the window +and you should see the cubes are no longer stretched tall or wide. +They stay the correct aspect regardless of window size. + +<img src="resources/images/resize-correct-aspect.png" width="407" class="threejs_center"> + +Now let's fix the blockiness. + +Canvas elements have 2 sizes. One size is the size the canvas is displayed +on the page. That's what we set with CSS. The other size is the +number of pixels in the canvas itself. This is no different than an image. +For example we might have a 128x64 pixel image and using +css we might display as 400x200 pixels. + +``` +<img src="some128x64image.jpg" style="width:400px; height:200px"> +``` + +A canvas's internal size, its resolution, is often called its drawingbuffer size. +In three.js we can set the canvas's drawingbuffer size by calling `renderer.setSize`. +What size should we pick? The most obvious answer is "the same size the canvas is displayed". +Again, to do that we can look at the canvas's `clientWidth` and `clientHeight` +attributes. + +Let's write a function that checks if the renderer's canvas is not +already the size it is being displayed as and if so set its size. + +``` +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; +} +``` + +Notice we check if the canvas actually needs to be resized. Resizing the canvas +is an interesting part of the canvas spec and it's best not to set the same +size if it's already the size we want. + +Once we know if we need to resize or not we then call `renderer.setSize` and +pass in the new width and height. It's important to pass `false` at the end. +`render.setSize` by default sets the canvas's CSS size but doing so is not +what we want. We want the browser to continue to work how it does for all other +elements which is to use CSS to determine the display size of the element. We don't +want canvases used by three to be different than other elements. + +Note that our function returns true if the canvas was resized. We can use +this to check if there are other things we should update. Let's modify +our render loop to use the new function + +``` +function render(time) { + time *= 0.001; + ++ if (resizeRendererToDisplaySize(renderer)) { ++ const canvas = renderer.domElement; ++ camera.aspect = client.clientWidth / client.clientHeight; ++ camera.updateProjectionMatrix(); ++ } + + ... +``` + +Since the apsect is only going to change if the canvas's display size +changed we only set the camera's aspect if `resizeRendererToDisplaySize` +returns `true`. + +{{{example url="../threejs-responsive.html" }}} + +It should now render with a resolution that matches the display +size of the canvas. + +To make the point about letting CSS handle the resizing let's take +our code and put it in a [separate `.js` file](../resources/threejs-responsive.js). +Here then are a few more examples where we let CSS choose the size and notice we had +to change zero code for them to work. + +Let's put our cubes in the middle of a paragraph of text. + +{{{example url="../threejs-responsive-paragraph.html" startPane="html" }}} + +and here's our same code used in an editor style layout +where the control area on the right can be resized. + +{{{example url="../threejs-responsive-editor.html" startPane="html" }}} + +The important part to notice is no code changed. Only our HTML and CSS +changed. + +## Handling HD-DPI displays + +HD-DPI stands for high-density dot per inch displays. +That's most Mac's now a days and many windows machines +as well as pretty much all smartphones. + +The way this works in the browser is they use +CSS pixels to set the sizes which are suppose to be the same +regardless of how high res the display is. The browser +will the just render text with more detail but the +same physical size. + +There are various ways to handle HD-DPI with three.js. + +The first one is just not to do anything special. This +is arguably the most common. Rendering 3D graphics +takes a lot of GPU processing power. Mobile GPUs have +less power than desktops, at least as of 2018, and yet +mobile phones often have very high resolution displays. +The current top of the line phones have a HD-DPI ratio +of 3x meaning for every one pixel from a non-HD-DPI display +those phones have 9 pixels. That means they have to do 9x +the rendering. + +Computing 9x the pixels is a lot of work so if we just +leave the code as it is we'll compute 1x the pixels and the +browser will just draw it at 3x the size (3x by 3x = 9x pixels). + +For any heavy three.js app that's probably what you want +otherwise you're likely to get a slow framerate. + +That said if you actually do want to render at the resolution +of the device there are a couple of ways to do this in three.js. + +One is to tell three.js a resolution multiplier using `renderer.setPixelRatio`. +You ask the browser what the multiplier is from CSS pixels to device pixels +and pass that to three.js + + renderer.setPixelRatio(window.devicePixelRatio); + +After that any calls to `renderer.setSize` will magicially +use the size you request multiplied by whatever pixel ratio +you passed in. + +The other way is to do it yourself when you resize the canvas. + +``` + function resizeRendererToDisplaySize(renderer) { + const canvas = renderer.domElement; + const pixelRatio = window.devicePixelRatio; + const width = canvas.clientWidth * pixelRatio; + const height = canvas.clientHeight * pixelRatio; + const needResize = canvas.width !== width || canvas.height !== height; + if (needResize) { + renderer.setSize(width, height, false); + } + return needResize; + } +``` + +I prefer this second way. Why? Because it means I get what I ask for. +There are many cases when using three.js where we need to know the actual +size of the canvas's drawingBuffer. For example when making a post processing filter, +or if we are making a shader that accesses `gl_FragCoord`, etc... +By doing it oursevles we always know the size being used is the size we requested. +There is no special case where magic is happening behind the scenes. + +Here's an example using the code above. + +{{{example url="../threejs-responsive-hd-dpi.html" }}} + +It might be hard to see the difference but if you have an HD-DPI +display and you compare this sample to those above you should +notice the edges are more crisp. + +This article covered a very basic but fundamental topic. Next up lets quickly +[go over the basic primitives that three.js provides](threejs-primitives.html). +
true
Other
mrdoob
three.js
cf6b82e0925e2795193a4e001b1cc947d26aea7b.json
add first 4 articles
threejs/lessons/threejs-scenegraph.md
@@ -0,0 +1,390 @@ +Title: Three.js Scenegraph +Description: What's a scene graph? + +This article is part of a series of articles about three.js. The +first article is [three.js fundamentals](three-fundamentals.html). If +you haven't read yet you might want to consider starting there. + +Three.js's core is arguably its scene graph. A scene graph in a 3D +engine is a hierarchy of nodes in a graph where each node represents +a local space. + +<img src="resources/images/scenegraph-generic.svg" align="center"> + +That's kind of abstract so let's try to give some examples. + +One example might be solar system, sun, earth, moon. + +<img src="resources/images/scenegraph-solarsystem.svg" align="center"> + +The Earth orbits the Sun. The Moon orbits the Earth. The Moon +moves in a circle around the Earth. From the Moon's point of +view it's rotating in the "local space" of the Earth. Even though +its motion relative to the Sun is some crazy spirograph like +curve from the Moon's point of view it just has to concern itself with rotating +around the Earth's local space. + +{{{diagram url="resources/moon-orbit.html" }}} + +To think of it another way, you living on the Earth do not have to think +about the Earth's rotation on its axis nor its rotation around the +Sun. You just walk or drive or swim or run as though the Earth is +not moving or rotating at all. You walk, drive, swim, run, and live +in the Earth's "local space" even though relative to the sun you are +spinning around the earth at around 1000 miles per hour and around +the sun at around 67,000 miles per hour. Your position in the solar +system is similar to that of the moon above but you don't have to concern +yourself. You just worry about your position relative to the earth its +"local space". + +Let's take it one step at a time. Imagine we want to make +a diagram of the sun, earth, and moon. We'll start with the sun by +just making a sphere and putting it at the origin. Note: We're using +sun, earth, moon as a demonstration of how to use a scenegraph. Of course +the real sun, earth, and moon use physics but for our purposes we'll +fake it with a scenegraph. + +``` +// an array of objects who's rotation to update +const objects = []; + +// use just one sphere for everything +const radius = 1; +const widthSegments = 6; +const heightSegments = 6; +const sphereGeometry = new THREE.SphereBufferGeometry( + radius, widthSegments, heightSegments); + +const sunMaterial = new THREE.MeshPhongMaterial({emissive: 0xFFFF00}); +const sunMesh = new THREE.Mesh(sphereGeometry, sunMaterial); +sunMesh.scale.set(5, 5, 5); // make the sun large +scene.add(sunMesh); +objects.push(sunMesh); +``` + +We're using a really low-polygon sphere. Only 6 subdivisions around its equator. +This is so it's easy to see the rotation. + +We're going to reuse the same sphere for everything so we'll set a scale +for the sun mesh of 5x. + +We also set the phong material's `emissive` property to yellow. A phong material's +emissive property is basically the color that will be drawn with no light hitting +the surface. Light is added to that color. + +Let's also put a single point light in the center of the scene. We'll go into more +details about point lights later but for now the simple version is a point light +represents light that eminates from a single point. + +``` +{ + const color = 0xFFFFFF; + const intensity = 3; + const light = new THREE.PointLight(color, intensity); + scene.add(light); +} +``` + +To make it easy to see we're going to put the camera directly above the origin +looking down. The easist way to do that us to use the `lookAt` function. The `lookAt` +function will orient the camera from its position to "lookAt the position +we pass to `lookAt`. Before we do that though we need to tell the camera +which way the top of the camera is facing or rather which way is "up" for the +camera. For most situations positive Y being up is good enough but since +we are looking straight down we need to tell the camera that positive Z is up. + +``` +const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); +camera.position.set(0, 50, 0); +camera.up.set(0, 0, 1); +camera.lookAt(0, 0, 0); +``` + +In the render loop, adapted from previous examples, we're rotating all +objects in our `objects` array with this code. + +``` +objects.forEach((obj) => { + obj.rotation.y = time; +}); +``` + +Since we added the `sunMesh` to the `objects` array it will rotate. + +{{{example url="../threejs-scenegraph-sun.html" }}} + +Now let's add an the earth. + +``` +const earthMaterial = new THREE.MeshPhongMaterial({color: 0x2233FF, emissive: 0x112244}); +const earthMesh = new THREE.Mesh(sphereGeometry, earthMaterial); +earthMesh.position.x = 10; +scene.add(earthMesh); +objects.push(earthMesh); +``` + +We make a material that is blue but we gave it a small amount of *emissive* blue +so that it will show up against our black background. + +We use the same `sphereGeometry` with our new blue `earthMaterial` to make +an `earthMesh`. We position that 10 units to the left of the sun +and add it to the scene. Since we added it to our `objects` array it will +rotate too. + +{{{example url="../threejs-scenegraph-sun-earth.html" }}} + +You can see both the sun and the earth are rotating but the earth is not +going around the sun. Let's make the earth a child of the sun + +``` +-scene.add(earthMesh); ++sunMesh.add(earthMesh); +``` + +and... + +{{{example url="../threejs-scenegraph-sun-earth-orbit.html" }}} + +What happened? Why is the earth the same size as the sun and why is it so far away? +I actually had to move the camera from 50 units above to 150 units above to see the earth. + +We made the `earthMesh` a child of the `sunMesh`. The `sunMesh` has +its scale set to 5x with `sunMesh.scale.set(5, 5, 5)`. That means the +`sunMesh`s local space is 5 times as big. Anything put in that space + will be multiplied by 5. That means the earth is now 5x larger and + it's distance from the sun (`earthMesh.position.x = 10`) is also + 5x as well. + + Our scene graph currently looks like this + +<img src="resources/images/scenegraph-sun-earth.svg" align="center"> + +To fix it let's add an empty scene graph node. We'll parent both the sun and the earth +to that node. + +``` ++const solarSystem = new THREE.Object3D(); ++scene.add(solarSystem); ++objects.push(solarSystem); + +const sunMaterial = new THREE.MeshPhongMaterial({emissive: 0xFFFF00}); +const sunMesh = new THREE.Mesh(sphereGeometry, sunMaterial); +sunMesh.scale.set(5, 5, 5); +-scene.add(sunMesh); ++solarSystem.add(sunMesh); +objects.push(sunMesh); + +const earthMaterial = new THREE.MeshPhongMaterial({color: 0x2233FF, emissive: 0x112244}); +const earthMesh = new THREE.Mesh(sphereGeometry, earthMaterial); +earthMesh.position.x = 10; +-sunMesh.add(earthMesh); ++solarSystem.add(earthMesh); +objects.push(earthMesh); +``` + +Here we made a `Object3D`. Like a `Mesh` it is also a node in the scene graph +but unlike a `Mesh` it has no material or geometry. It just represents a local space. + +Our new scene graph looks like this + +<img src="resources/images/scenegraph-sun-earth-fixed.svg" align="center"> + +Both the `sunMesh` and the `earthMesh` are children of the `solarSystem`. All 3 +are being rotated and now because the `earthMesh` is not a child of the `sunMesh` +it is no longer scaled by 5x. + +{{{example url="../threejs-scenegraph-sun-earth-orbit-fixed.html" }}} + +Much better. The earth is smaller than the sun and it's rotating around the sun +and rotating itself. + +Continuing that same pattern let's add a moon. + +``` ++const earthOrbit = new THREE.Object3D(); ++earthOrbit.position.x = 10; ++solarSystem.add(earthOrbit); ++objects.push(earthOrbit); + +const earthMaterial = new THREE.MeshPhongMaterial({color: 0x2233FF, emissive: 0x112244}); +const earthMesh = new THREE.Mesh(sphereGeometry, earthMaterial); +-solarSystem.add(earthMesh); ++earthOrbit.add(earthMesh); +objects.push(earthMesh); + ++const moonOrbit = new THREE.Object3D(); ++moonOrbit.position.x = 2; ++earthOrbit.add(moonOrbit); + ++const moonMaterial = new THREE.MeshPhongMaterial({color: 0x888888, emissive: 0x222222}); ++const moonMesh = new THREE.Mesh(sphereGeometry, moonMaterial); ++moonMesh.scale.set(.5, .5, .5); ++moonOrbit.add(moonMesh); ++objects.push(moonMesh); +``` + +Again we added another invisible scene graph node, a `Object3D` called `earthOrbit` +and added both the `earthMesh` and the `moonMesh` to it. The new scene graph looks like +this. + +<img src="resources/images/scenegraph-sun-earth-moon.svg" align="center"> + +and here's that + +{{{example url="../threejs-scenegraph-sun-earth-moon.html" }}} + +You can see the moon follows the spirograph pattern shown at the top +of this article but we didn't have to manually compute it. We just +setup our scene graph to do it for us. + +It is often useful to draw something to visualize the nodes in the scene graph. +Three.js has some helpful ummmm, helpers to ummm, ... help with this. + +One is called an `AxesHelper`. It draws 3 lines representing the local +<span style="color:red">X</span>, +<span style="color:green">Y</span>, and +<span style="color:blue">Z</span> axes. Let's add one to every node we +created. + +``` +// add an AxesHelper to each node +objects.forEach((node) => { + const axes = new THREE.AxesHelper(); + axes.material.depthTest = false; + axes.renderOrder = 1; + node.add(axes); +}); +``` + +On our case we want the axes to appear even though they are inside the spheres. +To do this we set their material's `depthTest` to false which means they will +not check to see if they are drawing behind something else. We also +set their `renderOrder` to 1 (the default is 0) so that they get drawn after +all the spheres. Otherwise a sphere might draw over them and cover them up. + +{{{example url="../threejs-scenegraph-sun-earth-moon-axes.html" }}} + +We can see the +<span style="color:red">x (red)</span> and +<span style="color:blue">z (blue)</span> axes. Since we are looking +straight down and each of our objects is only rotating around its +y axis we don't see much of the <span style="color:green">y (green)</span> axes. + +It might be hard to see some of them as there are 2 pairs of overlapping axes. Both the `sunMesh` +and the `solarSystem` are at the same position. Similarly the `earthMesh` and +`earthOrbit` are at the same position. Let's add some simple controls to allow us +to turn them on/off for each node. +While we're at it let's also add another helper called the `GridHelper`. It +makes a 2D grid on the X,Z plane. By default the grid is 10x10 units. + +We're also going to use [dat.GUI](https://github.com/dataarts/dat.gui) which is +a UI library that is very popular with three.js projects. dat.GUI takes an +object and a property name on that object and based on the type of the property +automatically makes a UI to manipulate that property. + +We want to make both a `GridHelper` and an `AxesHelper` for each node. We need +a label for each node so we'll get rid of the old loop and switch to calling +some function to add the helpers for each node + +``` +-// add an AxesHelper to each node +-objects.forEach((node) => { +- const axes = new THREE.AxesHelper(); +- axes.material.depthTest = false; +- axes.renderOrder = 1; +- node.add(axes); +-}); + ++function makeAxisGrid(node, label, units) { ++ const helper = new AxisGridHelper(node, units); ++ gui.add(helper, 'visible').name(label); ++} ++ ++makeAxisGrid(solarSystem, 'solarSystem', 25); ++makeAxisGrid(sunMesh, 'sunMesh'); ++makeAxisGrid(earthOrbit, 'earthOrbit'); ++makeAxisGrid(earthMesh, 'earthMesh'); ++makeAxisGrid(moonMesh, 'moonMesh'); +``` + +`makeAxisGrid` makes a `AxisGridHelper` which is class we'll create +to make dat.GUI happy. Like it says above dat.GUI +will automagically make a UI that manipulates the named property +of some object. It will create a different UI depending on the type +of property. We want it to create a checkbox so we need to specify +a `bool` property. But, we want both the axes and the grid +to appear/disappear based on a single property so we'll make a class +that has a getter and setter for a property. That way we can let dat.GUI +think it's manipulating a single property but internally we can set +the visible property of both the `AxesHelper` and `GridHelper` for a node. + +``` +// Turns both axes and grid visible on/off +// dat.GUI requires a property that returns a bool +// to decide to make a checkbox so we make a setter +// can getter for `visible` which we can tell dat.GUI +// to look at. +class AxisGridHelper { + constructor(node, units = 10) { + const axes = new THREE.AxesHelper(); + axes.material.depthTest = false; + axes.renderOrder = 2; // after the grid + node.add(axes); + + const grid = new THREE.GridHelper(units, units); + grid.material.depthTest = false; + grid.renderOrder = 1; + node.add(grid); + + this.grid = grid; + this.axes = axes; + this.visible = false; + } + get visible() { + return this._visible; + } + set visible(v) { + this._visible = v; + this.grid.visible = v; + this.axes.visible = v; + } +} +``` + +One thing to notice is we set the `renderOrder` of the `AxesHelper` +to 2 and for the `GridHelper` to 1 so that the axes get drawn after the grid. +Otherwise the grid might overwrite the axes. + +{{{example url="../threejs-scenegraph-sun-earth-moon-axes-grids.html" }}} + +Turn on the `solarSystem` and you'll see how the earth is exactly 10 +units out from the center just like we set above. You can see how the +earth is in the *local space* of the `solarSystem`. Similary if you +turn on the `earthOrbit` you'll see how the moon is exactly 2 units +from the center of the *local space* of the `earthOrbit`. + +A few more examples of scene graphs. An automobile in a simple game world might have a scene graph like this + +<img src="resources/images/scenegraph-car.svg" align="center"> + +If you move the car's body all the wheels will move with it. If you wanted the body +to bounce separate from the wheels you might parent the body and the wheels to a "frame" node +that represents the car's frame. + +Another example is a human in a game world. + +<img src="resources/images/scenegraph-human.svg" align="center"> + +You can see the scene graph gets pretty complex for a human. In fact +that scene graph above is simplified. For example you might extend it +to cover the every finger (at least another 28 nodes) and every toe +(yet another 28 nodes) plus ones for the and jaw, the eyes and maybe more. + +I hope this gives some idea of how scene graphs work and how you might use them. +Making `Object3D` nodes and parenting things to them is an important step to using +a 3D engine like three.js well. Often it might seem like some complex math is necessary +to make something move and rotate the way you want. For example without a scene graph +computing the motion of the moon or where to put the wheels of the car relative to its +body would be very complicated but using a scene graph it becomes much easier. + +[Next up we'll go over materials and lights](threejs-materials-and-lights.html). \ No newline at end of file
true
Other
mrdoob
three.js
80cd2e575f0f2075db4b844721f1bd8a08a176fd.json
remove articles so we can have a PR
threejs/lessons/threejs-fundamentals.md
@@ -1,316 +0,0 @@ -Title: Three.js Fundamentals -Description: Your first Three.js lesson starting with the fundamentals - -This is the first article in a series of articles about three.js. -[Three.js](http://threejs.org) is a 3D library that tries to make -it as easy as possible to get 3D content on a webpage. - -Three.js is often confused with WebGL since more often than -not, but not always, three.js uses WebGL to draw 3D. -WebGL is a very low-level -system that only draws points, lines, and triangles. To do -anything useful with WebGL generally requires quite a bit of -code and that is where three.js comes in. It handlings things -like scenes, lights, shadows, materials, textures, all things that you'd -have to write yourself if you were to use WebGL directly. - -These tutorials assume you already know JavaScript and, for the -most part they will use ES6 style JavaScript. Most browsers -that support three.js are auto-updated so most users should -be able to run this code. If you'd like to make this code run -on older browsers look into a transpiler like [Babel](http://babel.io). - -When learning most programming languages the first thing people -do is make the computer print `"Hello World!"`. For 3D one -of the most common first things to do is to make a 3D cube. -so let's start with "Hello Cube!" - -The first thing we need is a `<canvas>` tag so - -``` -<body> - <canvas id="c"></canvas> -</body> -``` - -Three.js will draw into that canvas so we need to look it up -and pass it to three.js. - -``` -<script> -'use strict'; - -function main() { - const canvas = document.querySelector('#c'); - const renderer = new THREE.WebGLRenderer({canvas: canvas}); - ... -</script> -``` - -Note there are some esoteric details here. If you don't pass a canvas -into three.js it will create one for you but then you have to add it -to your document. Where to add it may change depending on your use case -and you'll have to change your code so I find that passing a canvas -to three.js feels a little more flexible. I can put the canvas anywhere -and the code will find it where as if I had code to insert the canvas -into to the document I'd likely have to change that code if my use case -changed. - -After we look up the canvas we create a `WebGLRenderer`. The renderer -is the thing responsible for actually taking all the data you provide -and rendering it to the canvas. In the past there have been other renderers -like `CSSRenderer`, a `CanvasRenderer` and in the future there may be a -`WebGL2Renderer` or `WebGPURenderer`. For now there's the `WebGLRenderer` -that uses WebGL to render 3D to the canvas. - -Next up we need a camera. - -``` -const fov = 75; -const aspect = 2; // the canvas default -const zNear = 0.1; -const zFar = 5; -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); -``` - -`fov` is short for `field of view`. In this case 75 degrees in the vertical -dimension. Note that most angles in three.js are in radians but for some -reason the perspective camera takes degrees. - -`aspect` is the display aspect of the canvas. We'll go over the details -in another article but by default a canvas is 300x150 pixels which makes -the aspect 300/150 or 2. - -`zNear` and `zFar` represent the space in front of the camera -that will be rendered. Anything before that range or after that range -will be clipped (not drawn). - -Those 4 settings define a *"frustum"*. A *frustum* is the name of -a 3d shape that is like a pyramid with the tip sliced off. In other -words think of the word "frustum" as another 3D shape like sphere, -cube, prism, frustum. - -<img src="resources/frustum-3d.svg" width="500" class="threejs_center"/> - -The height of the zNear and zFar planes are determined by the field of view. -The width of both planes is determined by the field of view and the aspect. - -Anything inside the defined frustum will be be drawn. Anything outside -will not. - -The camera defaults to looking down the -Z axis with +Y up. We'll put our cube -at the origin so we need to move the camera back a litte from the origin -in order to see anything. - -``` -camera.position.z = 2; -``` - -Here's what we're aiming for. - -<img src="resources/scene-down.svg" width="500" class="threejs_center"/> - -In the diagram above we can see our camera is at `z = 2`. It's looking -down the -Z axis. Our frustum starts 0.1 units from the front of the camera -and goes to 5 units in front of the camera. Because in this diagram we are looking down, -the field of view is affected by the aspect. Our canvas is twice as wide -as it is tall so across view the field of view will be much wider than -our specified 75 degrees which is the vertical field of view. - -Next we make a `Scene`. A `Scene` in three.js is a form of scene graph. -Anything you want three.js to draw needs to be added to the scene. We'll -cover more details of how scenes work in a future article. - -``` -const scene = new THREE.Scene(); -``` - -Next up we create a `BoxGeometry` which contains the data for a box. -Almost anything we want to display in Three.js needs geometry which defines -the vertices that make up our 3D object. - -``` -const boxWidth = 1; -const boxHeight = 1; -const boxDepth = 1; -const geometry = new THREE.BoxGeometry(boxWidth, boxHeight, boxDepth); -``` - -We then create a basic material and set its color. Colors can -be specified using standard CSS style 6 digit hex color values. - -``` -const material = new THREE.MeshBasicMaterial({color: 0x44aa88}); -``` - -We then create a `Mesh`. A `Mesh` in three represents the combination -of a `Geometry` (the shape of the object) and a `Material` (how to draw -the object, shiny or flat, what color, what texture(s) to apply. Etc.) -as well as the position, orientation, and scale of that -object in the scene. - -``` -const cube = new THREE.Mesh(geometry, material); -``` - -And finally we add that mesh to the scene - -``` -scene.add(cube); -``` - -We can then render the scene by calling the renderer's render function -and passing it the scene and the camera - -``` -renderer.render(scene, camera); -``` - -Here's a working exmaple - -{{{example url="../threejs-fundamentals.html" }}} - -It's kind of hard to tell that is a 3D cube since we're viewing -it directly down the -Z axis and the cube itself is axis aligned -so we're only seeing a single face. - -Let's animate it spinning and hopefully that will make -it clear it's being drawn in 3D. To animate it we'll render inside a render loop using -[`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame). - -Here's our loop - -``` -function render(time) { - time *= 0.001; // convert time to seconds - - cube.rotation.x = time; - cube.rotation.y = time; - - renderer.render(scene, camera); - - requestAnimationFrame(render); -} -requestAnimationFrame(render); -``` - -`requestAnimationFrame` is a request to the browser that you want to animate something. -You pass it a function to be called. In our case that function is `render`. The browser -will call your function and if you update anything related to the display of the -page the browser will re-render the page. In our case we are calling three's -`renderer.render` function which will draw our scene. - -`requestAnimationFrame` passes the time since the page started rendering to -the our function. That time is passed in milliseconds. I find it's much -easier to work with seconds so here we're converting that to seconds. - -We then set the cube's X and Y rotation to the current time. These rotations -are in [radians](https://en.wikipedia.org/wiki/Radian). There are 2 pi radians -in a circle so our cube should turn around once on each axis in about 6.28 -seconds. - -We then render the scene and request another animation frame to continue -our loop. - -Outside the loop we call `requestAnimationFrame` one time to start the loop. - -{{{example url="../threejs-fundamentals-with-animation.html" }}} - -It's a little better but it's still hard to see the 3d. What would help is to add some lighting -so let's add a light. There are many kinds of lights in 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 light = new THREE.DirectionalLight(color, intensity); - light.position.set(-1, 2, 4); - scene.add(light); -} -``` - -Directional lights have a position and a target. Both default to 0, 0, 0. In our -case we're setting the light's position to -1, 2, 4 so it's slightly on the left, -above, and behind our camera. The target is still 0, 0, 0 so it will shine -toward the origin. - -We also need to change the material. The `MeshBasicMaterial` is not affected by -lights. Let's change it to a `MeshPhongMaterial` which is affected by lights. - -``` --const material = new THREE.MeshBasicMaterial({color: 0x44aa88}); // greenish blue -+const material = new THREE.MeshPhongMaterial({color: 0x44aa88}); // greenish blue -``` - -And here it is working. - -{{{example url="../threejs-fundamentals-with-light.html" }}} - -It should now be pretty clearly 3D. - -Just for the fun of it let's add 2 more cubes. - -We'll use the same geometry for each cube but make a different -material so each cube can be a different color. - -First we'll make a function that creates a new material -with the specified color. Then it creates a mesh using -the specified geometry and adds it to the scene and -sets its X position. - -``` -function makeInstance(geometry, color, x) { - const material = new THREE.MeshPhongMaterial({color}); - - const cube = new THREE.Mesh(geometry, material); - scene.add(cube); - - cube.position.x = x; - - return cube; -} -``` - -Then we'll call it 3 times with 3 different colors and X positions -saving the `Mesh` instances in an array. - -``` -const cubes = [ - makeInstance(geometry, 0x44aa88, 0), - makeInstance(geometry, 0x8844aa, -2), - makeInstance(geometry, 0xaa8844, 2), -]; -``` - -Finally we'll spin all 3 cubes in our render function. We -compute a slightly different rotation for each one. - -``` -function render(time) { - time *= 0.001; // convert time to seconds - - cubes.forEach((cube, ndx) => { - const speed = 1 + ndx * .1; - const rot = time * speed; - cube.rotation.x = rot; - cube.rotation.y = rot; - }); - - ... -``` - -and here's that. - -{{{example url="../threejs-fundamentals-3-cubes.html" }}} - -If you compare it to the top down diagram above you can see -it matches our expectections. With cubes at X = -2 and X = +2 -they are partially outside our frustum. They are also -somewhat exaggeratedly warped since the field of view -across the canvas is so extreme. - -I hope this short intro helps to get things started. [Next up we'll cover -making our code responsive so it is adaptable to multiple situations](threejs-responsive.html). -
true
Other
mrdoob
three.js
80cd2e575f0f2075db4b844721f1bd8a08a176fd.json
remove articles so we can have a PR
threejs/lessons/threejs-materials-and-lights.md
@@ -1,8 +0,0 @@ -Title: Three.js Materials and Lights -Description: Materials and Lights - -This article is part of a series of articles about three.js. The -first article is [three.js fundamentals](three-fundamentals.html). If -you haven't read yet you might want to consider starting there. - -TBD
true
Other
mrdoob
three.js
80cd2e575f0f2075db4b844721f1bd8a08a176fd.json
remove articles so we can have a PR
threejs/lessons/threejs-primitives.md
@@ -1,394 +0,0 @@ -Title: Three.js Primitives -Description: A tour of three.js primitives. - -This article one in a series of articles about three.js. -The first article was [about fundamentals](threejs-fundamentals.html). -If you haven't read that yet you might want to start there. - -Three.js has a large number of primitives. Primitives -are generally 3D shapes that are generated at runtime -with a bunch of parameters. - -It's common to use primitives for things like a sphere -for globe or a bunch of boxes to draw a 3D graph. It's -especially common to use primitives to experiment -and get started with 3D. For the majority if 3D apps -it's more common to have an artist make 3D models -in a 3D modeling program. Later in this series we'll -cover making and loading data from several 3D modeling -programs. For now let's go over some of the available -primitives. - -<div class="primitives"> -<div data-primitive="BoxBufferGeometry">A Box</div> -<div data-primitive="CircleBufferGeometry">A flat circle</div> -<div data-primitive="ConeBufferGeometry">A Cone</div> -<div data-primitive="CylinderBufferGeometry">A Cylinder</div> -<div data-primitive="DodecahedronBufferGeometry">A dodecahedron (12 sides)</div> -<div data-primitive="ExtrudeBufferGeometry">An extruded 2d shape with optional bevelling. -Here we are extruding a heart shape. Note this is the basis -for <code>TextBufferGeometry</code> and <code>TextGeometry</code> respectively.</div> -<div data-primitive="IcosahedronBufferGeometry">An icosahedron (20 sides)</div> -<div data-primitive="LatheBufferGeometry">A shape generated by spinning a line. Examples would lamps, bowling pins, candles, candle holders, wine glasses, drinking glasses, etc... You provide the 2d silhouette as series of points and then tell three.js how many subdivisions to make as it spins the silhouette around an axis.</div> -<div data-primitive="OctahedronBufferGeometry">An Octahedron (8 sides)</div> -<div data-primitive="ParametricBufferGeometry">A surface generated by providing a function that takes a 2d point from a grid and returns the corresponding 3d point.</div> -<div data-primitive="PlaneBufferGeometry">A 2D plane</div> -<div data-primitive="PolyhedronBufferGeometry">Takes a set of triangles centered around a point and projects them onto a sphere</div> -<div data-primitive="RingBufferGeometry">A 2D disc with a hole in the center</div> -<div data-primitive="ShapeBufferGeometry">A 2d outline that gets trianglulated</div> -<div data-primitive="SphereBufferGeometry">A sphere</div> -<div data-primitive="TetrahedronBufferGeometry">A terahedron (4 sides)</div> -<div data-primitive="TextBufferGeometry">3D Text generated from a 3D font and a string</div> -<div data-primitive="TorusBufferGeometry">A torus (donut)</div> -<div data-primitive="TorusKnotBufferGeometry">A torus knot</div> -<div data-primitive="TubeBufferGeometry">A circle traced down a path</div> -<div data-primitive="EdgesGeometry">A helper object that takes another geometry as input and generates edges only if the angle between faces is greater than some threshold. For example if you look at the box at the top it shows a line going through each face showing every triangle that makes the box. Using an EdgesGeometry instead the middle lines are removed.</div> -<div data-primitive="WireframeGeometry">Generates geometry that contains one line segment (2 points) per edge in the given geometry. With out this you'd often be missing edges or get extra edges since WebGL generally requires 2 points per line segment. For example if all you had was a single triangle there would only be 3 points. If you tried to draw it using a material with <code>wireframe: true</code> you would only get a single line. Passing that triangle geometry to a <code>WireframeGeometry</code> will generate a new Geometry that has 3 lines segments using 6 points..</div> -</div> - -You might notice of most of them come in pairs of `Geometry` -or `BufferGeometry`. The difference between the 2 types is effectively flexibility -vs performance. - -`BufferGeometry` based primitves are the performance oriented -types. The vertices for the geometry are generated directly -into an efficient typed array format ready to be uploaded to the GPU -for rendering. This means they are faster to start up -and take less memory but if you want to modify their -data they take what is often considered more complex -programming to manipulate. - -`Geometry` based primitives are the more flexible, easier to manipulate -type. They are built from JavaScript based classes like `Vector3` for -3D points, `Face3` for triangles. -They take quite a bit of memory and before they can be rendered three.js will need to -convert them to something similar to the corresponding `BufferGeometry` representation. - -If you know you are not going to manipulate a primitive or -if you're comfortable doing the math to manipulate their -internals then it's best to go with the `BufferGeometry` -based primitives. If on the other hand you want to change -a few things before rendering you might find the `Geometry` -based primitives easier to deal with. - -As an simple example a `BufferGeometry` -can not have new vertices easily added. The number of vertices used is -decided at creation time, storage is created, and then data for vertices -are filled in. Where as for `Geometry` you can add vertices as you go. - -We'll go over creating custom geometry in another article. For now -let's make an example creating each type of primitive. We'll start -with the [examples from the previous article](threejs-responsive.html). - -Near the top let's set a background color - -``` -const canvas = document.querySelector('#c'); -const renderer = new THREE.WebGLRenderer({canvas: canvas}); -+renderer.setClearColor(0xAAAAAA); -``` - -This tells three.js to clear to lightish gray. - -The camera needs to change position so that we can see all the -objects. - -``` --const fov = 75; -+const fov = 40; -const aspect = 2; // the canvas default -const zNear = 0.1; --const zFar = 5; -+const zFar = 1000; -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); --camera.position.z = 2; -+camera.position.z = 120; -``` - -Let's add a function, `addObject`, that takes an x, y position and an `Object3D` and adds -the object to the scene. - -``` -const objects = []; -const spread = 15; - -function addObject(x, y, obj) { - obj.position.x = x * spread; - obj.position.y = y * spread; - - scene.add(obj); - objects.push(obj); -} -``` - -Let's also make a function to create a random colored material. -We'll use a feature of `Color` that lets you set a color -based on hue, saturation, and luminance. - -`hue` goes from 0 to 1 around the color wheel with -red at 0, green at .33 and blue at .66. `saturation` -goes from 0 to 1 with 0 having no color and 1 being -most saturated. `luminance` goes from 0 to 1 -with 0 being black, 1 being white and 0.5 being -the maximum amount of color. In other words -as `luminance` goes from 0.0 to 0.5 the color -will go from black to `hue`. From 0.5 to 1.0 -the color will go from `hue` to white. - -``` -function createMaterial() { - const material = new THREE.MeshPhongMaterial({ - side: THREE.DoubleSide, - }); - - const hue = Math.random(); - const saturation = 1; - const luminance = .5; - material.color.setHSL(hue, saturation, luminance); - - return material; -} -``` - -We also passed `side: THREE.DoubleSide` to the material. -This tells three to draw both sides of the triangles -that make up a shape. For a solid shape like a sphere -or a cube there's usually no reason to draw the -back sides of triangles as they all face inside the -shape. In our case though we are drawing a few things -like the `PlaneBufferGeometry` and the `ShapeBufferGeometry` -which are 2 dimensional and so have no inside. Without -setting `side: THREE.DoubleSide` they would disappear -when looking at their back sides. - -I should note that it's faster to draw when **not** setting -`side: THREE.DoubleSide` so ideally we'd set it only on -the materials that really need it but in this case we -are not drawing too much so there isn't much reason to -worry about it. - -Let's make a function, `addSolidGeometry`, that -we pass a geometry and it creates a random colored -material via `createMaterial` and adds it to the scene -via `addObject`. - -``` -function addSolidGeometry(x, y, geometry) { - const mesh = new THREE.Mesh(geometry, createMaterial()); - addObject(x, y, mesh); -} -``` - -Now we can use this for the majority of the primitves we create. -For example creating a box - -``` -{ - const width = 8; - const height = 8; - const depth = 8; - addSolidGeometry(-2, -2, new THREE.BoxBufferGeometry(width, height, depth)); -} -``` - -If you look in the code below you'll see a similar section for each type of geometry. - -Here's the result: - -{{{example url="../threejs-primitives.html" }}} - -There are a couple of notable exceptions to the pattern above. -The biggest is probably the `TextBufferGeometry`. It needs to load -3D font data before it can generate a mesh for the text. -That data loads asynchronously so we need to wait for it -to load before trying to create the geometry. You can see below -we create a `FontLoader` and pass it the url to our font -and a callback. The callback is called after the font loads. -In the callback we create the geometry -and call `addObject` to add it the scene. - -``` -{ - const loader = new THREE.FontLoader(); - loader.load('resources/threejs/fonts/helvetiker_regular.typeface.json', (font) => { - const geometry = new THREE.TextBufferGeometry('three.js', { - font: font, - size: 3.0, - height: .2, - curveSegments: 12, - bevelEnabled: true, - bevelThickness: 0.15, - bevelSize: .3, - bevelSegments: 5, - }); - const mesh = new THREE.Mesh(geometry, createMaterial()); - geometry.computeBoundingBox(); - geometry.boundingBox.getCenter(mesh.position).multiplyScalar(-1); - - const parent = new THREE.Object3D(); - parent.add(mesh); - - addObject(-1, 1, parent); - }); -} -``` - -There's one other difference. We want to spin the text around its -center but by default three.js creates the text such that its center of rotation -is on the left edge. To work around this we can ask three.js to compute the bounding -box of the geometry. We can then call the `getCenter` method -of the bounding box and pass it our mesh's position object. -`getCenter` copies the center of the box into the position. -It also returns the position object so we can call `multiplyScaler(-1)` -to position the entire object such that its center of rotation -is at the center of the object. - -If we then just called `addSolidGeometry` like with previous -examples it would set the position again which is -no good. So, in this case we create an `Object3D` which -is the standard node for the three.js scene graph. `Mesh` -is inherited from `Object3D` as well. We'll cover [how the scene graph -works in another article](threejs-scenegraph.html). -For now it's enough to know that -like DOM nodes, children are drawn relative to their parent. -By making an `Object3D` and making our mesh a child of that -we can position the `Object3D` where ever we want and still -keep the center offset we set earilier. - -If we didn't do this the text would spin off center. - -{{{example url="../threejs-primitives-text.html" }}} - -Notice the one on the left is not spinning around its center -where as the one on the right is. - -The other exceptions are the 2 line based examples for `EdgesGeometry` -and `WireframeGeometry`. Instead of calling `addSolidGeometry` they call -`addLineGeomtry` which looks like this - -``` -function addLineGeometry(x, y, geometry) { - const material = new THREE.LineBasicMaterial({color: 0x000000}); - const mesh = new THREE.LineSegments(geometry, material); - addObject(x, y, mesh); -} -``` - -It creates a black `LineBasicMaterial` and then creates a `LineSegments` -object which is a wrapper for `Mesh` that helps three know you're rendering -line segments (2 points per segment). - -Each of the primitives has several parameters you can pass on creation -and it's best to [look in the documentation](https://threejs.org/docs/) for all of them rather than -repeat them here. You can also click the links above next to each shape -to take you directly to the docs for that shape. - -One other thing that's important to cover is that almost all shapes -have various settings for how much to subdivde them. A good example -might be the sphere geometries. Spheres take parameters for -how many divisions to make around and how many top to bottom. For example - -<div class="spread"> -<div data-primitive-diagram="SphereBufferGeometryLow"></div> -<div data-primitive-diagram="SphereBufferGeometryMedium"></div> -<div data-primitive-diagram="SphereBufferGeometryHigh"></div> -</div> - -The first sphere has 5 segments around and 3 high which is 15 segments -or 30 triangles. The second sphere has 24 segments by 10. That's 240 segments -or 480 triangles. The last one has 50 by 50 which is 2500 segments or 5000 triangles. - -It's up to you to decide how many subdivisions you need. It might -look like you need a high number of segments but remove the lines -and the flat shading and we get this - -<div class="spread"> -<div data-primitive-diagram="SphereBufferGeometryLowSmooth"></div> -<div data-primitive-diagram="SphereBufferGeometryMediumSmooth"></div> -<div data-primitive-diagram="SphereBufferGeometryHighSmooth"></div> -</div> - -It's now not so clear that the one on the right with 5000 triangles -is entirely better than the one in the middle with only 480. -If you're only drawing a few spheres, like say a single globe for -a map of the earth, then a single 10000 triangle sphere is not a bad -choice. If on the otherhand you're trying to draw 1000 spheres -then 1000 spheres times 10000 triangles each is 10 million triangles. -To animate smoothly you need the browser to draw at 60 frames a -second so you'd be asking the browser to draw 600 million triangles -per second. That's a lot of computing. - -Sometimes it's easy to choose. For example you can also choose -to subdivide a plane. - -<div class="spread"> -<div data-primitive-diagram="PlaneBufferGeometryLow"></div> -<div data-primitive-diagram="PlaneBufferGeometryHigh"></div> -</div> - -The plane on the left is 2 triangles. The plane on the right -is 200 triangles. Unlike the sphere there is really no trade off in quality for most -use cases of a plane. You'd most likely only subdivide a plane -if you expected to want to modify or warp it in some way. A box -is similar. - -So, choose whatever is appropriate for your situation. The less -subdivisions you choose the more likely things will run smoothly and the less -memory they'll take. You'll have to decide for yourself what the correct -tradeoff is for your particular siutation. - -Next up let's go over [how three's scene graph works and how -to use it](threejs-scenegraph.html). - -<canvas id="c"></canvas> -<script src="../resources/threejs/r94/three.min.js"></script> -<script src="../resources/threejs/r94/js/controls/TrackballControls.js"></script> -<script src="resources/threejs-primitives.js"></script> -<style> -.spread { - display: flex; -} -.spread>div { - flex: 1 1 auto; - height: 150px; -} -.primitives { -} -.primitives>div { - display: flex; - align-items: center; - margin-bottom: 1em; -} -.primitives .shape { - flex: 0 0 auto; - width: 200px; - height: 200px; -} -.primitives .desc { - word-wrap: break-word; - padding: 1em; - min-width: 0; -} -.primitives .desc code { - white-space: normal; -} -@media (max-width: 550px) { - .primitives .shape { - width: 120px; - height: 120px; - } -} -.primitives .desc { - flex: 1 1 auto; -} -#c { - position: absolute; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - z-index: -100; -} -</style> - -
true
Other
mrdoob
three.js
80cd2e575f0f2075db4b844721f1bd8a08a176fd.json
remove articles so we can have a PR
threejs/lessons/threejs-responsive.md
@@ -1,271 +0,0 @@ -Title: Three.js Responsive Design -Description: How to make your three.js fit different sized displays. - -This is the second article in a series of articles about three.js. -The first article was [about fundamentals](threejs-fundamentals.html). -If you haven't read that yet you might want to start there. - -This article is about how to make your three.js app be responsive -to any situation. Making a webpage responsive generally refers -to the page displaying well on different sized displays from -desktops to tablets to phones. - -For three.js there are even more situations to consider. For -example a 3D editor with controls on the left, right, top, or -bottom is something we might want to handle. A live diagram -in the middle of a document is another example. - -The last sample we had used a plain canvas with no css and -no size - -``` -<canvas id="c"></canvas> -``` - -That canvas defaults to 300x150 css pixels in size. - -In the web platform the recommended way to set the size -of something is to use CSS. - -Let's make the canvas fill the page by adding CSS - -``` -<style> -html, body { - margin: 0; - height: 100%; -} -#c { - width: 100%; - height: 100%; - display: block; -} -</style> -``` - -In HTML the body has a margin of 5px pixels by default so setting the -margin to 0 removes the margin. Setting the html and body height to 100% -makes them fill the window. Otherwise they are only as large -as the content that fills them. - -Next we tell the `id=c` element to be -100% the size of its container which in this case is the body of -the document. - -Finally we set its `display` mode to `block`. A canvas's -default display mode is `inline`. Inline -elements can end up adding whitespace to what is displayed. By -setting the canvas to `block` that issue goes away. - -Here's the result - -{{{example url="../threejs-responsive-no-resize.html" }}} - -You can see the canvas is now filling the page but there are 2 -problems. One our cubes are stretched. They are not cubes they -are more like boxes. Too tall or too wide. Open the -example in its own window and resize it. You'll see how -the cubes get stretched wide and tall. - -<img src="resources/images/resize-incorrect-aspect.png" width="407" class="threejs_center"> - -The second problem is they look low resolution or blocky and -blurry. Stretch the window really large and you'll really see -the issue. - -<img src="resources/images/resize-low-res.png" class="threejs_center"> - -Let's fix the stretchy problem first. To do that we need -to set the aspect of the camera to the aspect of the canvas's -display size. We can do that by looking at the canvas's -`clientWidth` and `clientHeight` properties. - -We'll update our render loop like this - -``` -function render(time) { - time *= 0.001; - -+ const canvas = renderer.domElement; -+ camera.aspect = client.clientWidth / client.clientHeight; -+ camera.updateProjectionMatrix(); - - ... -``` - -Now the cubes should stop being distorted. - -{{{example url="../threejs-responsive-update-camera.html" }}} - -Open the example in a separate window and resize the window -and you should see the cubes are no longer stretched tall or wide. -They stay the correct aspect regardless of window size. - -<img src="resources/images/resize-correct-aspect.png" width="407" class="threejs_center"> - -Now let's fix the blockiness. - -Canvas elements have 2 sizes. One size is the size the canvas is displayed -on the page. That's what we set with CSS. The other size is the -number of pixels in the canvas itself. This is no different than an image. -For example we might have a 128x64 pixel image and using -css we might display as 400x200 pixels. - -``` -<img src="some128x64image.jpg" style="width:400px; height:200px"> -``` - -A canvas's internal size, its resolution, is often called its drawingbuffer size. -In three.js we can set the canvas's drawingbuffer size by calling `renderer.setSize`. -What size should we pick? The most obvious answer is "the same size the canvas is displayed". -Again, to do that we can look at the canvas's `clientWidth` and `clientHeight` -attributes. - -Let's write a function that checks if the renderer's canvas is not -already the size it is being displayed as and if so set its size. - -``` -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; -} -``` - -Notice we check if the canvas actually needs to be resized. Resizing the canvas -is an interesting part of the canvas spec and it's best not to set the same -size if it's already the size we want. - -Once we know if we need to resize or not we then call `renderer.setSize` and -pass in the new width and height. It's important to pass `false` at the end. -`render.setSize` by default sets the canvas's CSS size but doing so is not -what we want. We want the browser to continue to work how it does for all other -elements which is to use CSS to determine the display size of the element. We don't -want canvases used by three to be different than other elements. - -Note that our function returns true if the canvas was resized. We can use -this to check if there are other things we should update. Let's modify -our render loop to use the new function - -``` -function render(time) { - time *= 0.001; - -+ if (resizeRendererToDisplaySize(renderer)) { -+ const canvas = renderer.domElement; -+ camera.aspect = client.clientWidth / client.clientHeight; -+ camera.updateProjectionMatrix(); -+ } - - ... -``` - -Since the apsect is only going to change if the canvas's display size -changed we only set the camera's aspect if `resizeRendererToDisplaySize` -returns `true`. - -{{{example url="../threejs-responsive.html" }}} - -It should now render with a resolution that matches the display -size of the canvas. - -To make the point about letting CSS handle the resizing let's take -our code and put it in a [separate `.js` file](../resources/threejs-responsive.js). -Here then are a few more examples where we let CSS choose the size and notice we had -to change zero code for them to work. - -Let's put our cubes in the middle of a paragraph of text. - -{{{example url="../threejs-responsive-paragraph.html" startPane="html" }}} - -and here's our same code used in an editor style layout -where the control area on the right can be resized. - -{{{example url="../threejs-responsive-editor.html" startPane="html" }}} - -The important part to notice is no code changed. Only our HTML and CSS -changed. - -## Handling HD-DPI displays - -HD-DPI stands for high-density dot per inch displays. -That's most Mac's now a days and many windows machines -as well as pretty much all smartphones. - -The way this works in the browser is they use -CSS pixels to set the sizes which are suppose to be the same -regardless of how high res the display is. The browser -will the just render text with more detail but the -same physical size. - -There are various ways to handle HD-DPI with three.js. - -The first one is just not to do anything special. This -is arguably the most common. Rendering 3D graphics -takes a lot of GPU processing power. Mobile GPUs have -less power than desktops, at least as of 2018, and yet -mobile phones often have very high resolution displays. -The current top of the line phones have a HD-DPI ratio -of 3x meaning for every one pixel from a non-HD-DPI display -those phones have 9 pixels. That means they have to do 9x -the rendering. - -Computing 9x the pixels is a lot of work so if we just -leave the code as it is we'll compute 1x the pixels and the -browser will just draw it at 3x the size (3x by 3x = 9x pixels). - -For any heavy three.js app that's probably what you want -otherwise you're likely to get a slow framerate. - -That said if you actually do want to render at the resolution -of the device there are a couple of ways to do this in three.js. - -One is to tell three.js a resolution multiplier using `renderer.setPixelRatio`. -You ask the browser what the multiplier is from CSS pixels to device pixels -and pass that to three.js - - renderer.setPixelRatio(window.devicePixelRatio); - -After that any calls to `renderer.setSize` will magicially -use the size you request multiplied by whatever pixel ratio -you passed in. - -The other way is to do it yourself when you resize the canvas. - -``` - function resizeRendererToDisplaySize(renderer) { - const canvas = renderer.domElement; - const pixelRatio = window.devicePixelRatio; - const width = canvas.clientWidth * pixelRatio; - const height = canvas.clientHeight * pixelRatio; - const needResize = canvas.width !== width || canvas.height !== height; - if (needResize) { - renderer.setSize(width, height, false); - } - return needResize; - } -``` - -I prefer this second way. Why? Because it means I get what I ask for. -There are many cases when using three.js where we need to know the actual -size of the canvas's drawingBuffer. For example when making a post processing filter, -or if we are making a shader that accesses `gl_FragCoord`, etc... -By doing it oursevles we always know the size being used is the size we requested. -There is no special case where magic is happening behind the scenes. - -Here's an example using the code above. - -{{{example url="../threejs-responsive-hd-dpi.html" }}} - -It might be hard to see the difference but if you have an HD-DPI -display and you compare this sample to those above you should -notice the edges are more crisp. - -This article covered a very basic but fundamental topic. Next up lets quickly -[go over the basic primitives that three.js provides](threejs-primitives.html). -
true
Other
mrdoob
three.js
80cd2e575f0f2075db4b844721f1bd8a08a176fd.json
remove articles so we can have a PR
threejs/lessons/threejs-scenegraph.md
@@ -1,390 +0,0 @@ -Title: Three.js Scenegraph -Description: What's a scene graph? - -This article is part of a series of articles about three.js. The -first article is [three.js fundamentals](three-fundamentals.html). If -you haven't read yet you might want to consider starting there. - -Three.js's core is arguably its scene graph. A scene graph in a 3D -engine is a hierarchy of nodes in a graph where each node represents -a local space. - -<img src="resources/images/scenegraph-generic.svg" align="center"> - -That's kind of abstract so let's try to give some examples. - -One example might be solar system, sun, earth, moon. - -<img src="resources/images/scenegraph-solarsystem.svg" align="center"> - -The Earth orbits the Sun. The Moon orbits the Earth. The Moon -moves in a circle around the Earth. From the Moon's point of -view it's rotating in the "local space" of the Earth. Even though -its motion relative to the Sun is some crazy spirograph like -curve from the Moon's point of view it just has to concern itself with rotating -around the Earth's local space. - -{{{diagram url="resources/moon-orbit.html" }}} - -To think of it another way, you living on the Earth do not have to think -about the Earth's rotation on its axis nor its rotation around the -Sun. You just walk or drive or swim or run as though the Earth is -not moving or rotating at all. You walk, drive, swim, run, and live -in the Earth's "local space" even though relative to the sun you are -spinning around the earth at around 1000 miles per hour and around -the sun at around 67,000 miles per hour. Your position in the solar -system is similar to that of the moon above but you don't have to concern -yourself. You just worry about your position relative to the earth its -"local space". - -Let's take it one step at a time. Imagine we want to make -a diagram of the sun, earth, and moon. We'll start with the sun by -just making a sphere and putting it at the origin. Note: We're using -sun, earth, moon as a demonstration of how to use a scenegraph. Of course -the real sun, earth, and moon use physics but for our purposes we'll -fake it with a scenegraph. - -``` -// an array of objects who's rotation to update -const objects = []; - -// use just one sphere for everything -const radius = 1; -const widthSegments = 6; -const heightSegments = 6; -const sphereGeometry = new THREE.SphereBufferGeometry( - radius, widthSegments, heightSegments); - -const sunMaterial = new THREE.MeshPhongMaterial({emissive: 0xFFFF00}); -const sunMesh = new THREE.Mesh(sphereGeometry, sunMaterial); -sunMesh.scale.set(5, 5, 5); // make the sun large -scene.add(sunMesh); -objects.push(sunMesh); -``` - -We're using a really low-polygon sphere. Only 6 subdivisions around its equator. -This is so it's easy to see the rotation. - -We're going to reuse the same sphere for everything so we'll set a scale -for the sun mesh of 5x. - -We also set the phong material's `emissive` property to yellow. A phong material's -emissive property is basically the color that will be drawn with no light hitting -the surface. Light is added to that color. - -Let's also put a single point light in the center of the scene. We'll go into more -details about point lights later but for now the simple version is a point light -represents light that eminates from a single point. - -``` -{ - const color = 0xFFFFFF; - const intensity = 3; - const light = new THREE.PointLight(color, intensity); - scene.add(light); -} -``` - -To make it easy to see we're going to put the camera directly above the origin -looking down. The easist way to do that us to use the `lookAt` function. The `lookAt` -function will orient the camera from its position to "lookAt the position -we pass to `lookAt`. Before we do that though we need to tell the camera -which way the top of the camera is facing or rather which way is "up" for the -camera. For most situations positive Y being up is good enough but since -we are looking straight down we need to tell the camera that positive Z is up. - -``` -const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); -camera.position.set(0, 50, 0); -camera.up.set(0, 0, 1); -camera.lookAt(0, 0, 0); -``` - -In the render loop, adapted from previous examples, we're rotating all -objects in our `objects` array with this code. - -``` -objects.forEach((obj) => { - obj.rotation.y = time; -}); -``` - -Since we added the `sunMesh` to the `objects` array it will rotate. - -{{{example url="../threejs-scenegraph-sun.html" }}} - -Now let's add an the earth. - -``` -const earthMaterial = new THREE.MeshPhongMaterial({color: 0x2233FF, emissive: 0x112244}); -const earthMesh = new THREE.Mesh(sphereGeometry, earthMaterial); -earthMesh.position.x = 10; -scene.add(earthMesh); -objects.push(earthMesh); -``` - -We make a material that is blue but we gave it a small amount of *emissive* blue -so that it will show up against our black background. - -We use the same `sphereGeometry` with our new blue `earthMaterial` to make -an `earthMesh`. We position that 10 units to the left of the sun -and add it to the scene. Since we added it to our `objects` array it will -rotate too. - -{{{example url="../threejs-scenegraph-sun-earth.html" }}} - -You can see both the sun and the earth are rotating but the earth is not -going around the sun. Let's make the earth a child of the sun - -``` --scene.add(earthMesh); -+sunMesh.add(earthMesh); -``` - -and... - -{{{example url="../threejs-scenegraph-sun-earth-orbit.html" }}} - -What happened? Why is the earth the same size as the sun and why is it so far away? -I actually had to move the camera from 50 units above to 150 units above to see the earth. - -We made the `earthMesh` a child of the `sunMesh`. The `sunMesh` has -its scale set to 5x with `sunMesh.scale.set(5, 5, 5)`. That means the -`sunMesh`s local space is 5 times as big. Anything put in that space - will be multiplied by 5. That means the earth is now 5x larger and - it's distance from the sun (`earthMesh.position.x = 10`) is also - 5x as well. - - Our scene graph currently looks like this - -<img src="resources/images/scenegraph-sun-earth.svg" align="center"> - -To fix it let's add an empty scene graph node. We'll parent both the sun and the earth -to that node. - -``` -+const solarSystem = new THREE.Object3D(); -+scene.add(solarSystem); -+objects.push(solarSystem); - -const sunMaterial = new THREE.MeshPhongMaterial({emissive: 0xFFFF00}); -const sunMesh = new THREE.Mesh(sphereGeometry, sunMaterial); -sunMesh.scale.set(5, 5, 5); --scene.add(sunMesh); -+solarSystem.add(sunMesh); -objects.push(sunMesh); - -const earthMaterial = new THREE.MeshPhongMaterial({color: 0x2233FF, emissive: 0x112244}); -const earthMesh = new THREE.Mesh(sphereGeometry, earthMaterial); -earthMesh.position.x = 10; --sunMesh.add(earthMesh); -+solarSystem.add(earthMesh); -objects.push(earthMesh); -``` - -Here we made a `Object3D`. Like a `Mesh` it is also a node in the scene graph -but unlike a `Mesh` it has no material or geometry. It just represents a local space. - -Our new scene graph looks like this - -<img src="resources/images/scenegraph-sun-earth-fixed.svg" align="center"> - -Both the `sunMesh` and the `earthMesh` are children of the `solarSystem`. All 3 -are being rotated and now because the `earthMesh` is not a child of the `sunMesh` -it is no longer scaled by 5x. - -{{{example url="../threejs-scenegraph-sun-earth-orbit-fixed.html" }}} - -Much better. The earth is smaller than the sun and it's rotating around the sun -and rotating itself. - -Continuing that same pattern let's add a moon. - -``` -+const earthOrbit = new THREE.Object3D(); -+earthOrbit.position.x = 10; -+solarSystem.add(earthOrbit); -+objects.push(earthOrbit); - -const earthMaterial = new THREE.MeshPhongMaterial({color: 0x2233FF, emissive: 0x112244}); -const earthMesh = new THREE.Mesh(sphereGeometry, earthMaterial); --solarSystem.add(earthMesh); -+earthOrbit.add(earthMesh); -objects.push(earthMesh); - -+const moonOrbit = new THREE.Object3D(); -+moonOrbit.position.x = 2; -+earthOrbit.add(moonOrbit); - -+const moonMaterial = new THREE.MeshPhongMaterial({color: 0x888888, emissive: 0x222222}); -+const moonMesh = new THREE.Mesh(sphereGeometry, moonMaterial); -+moonMesh.scale.set(.5, .5, .5); -+moonOrbit.add(moonMesh); -+objects.push(moonMesh); -``` - -Again we added another invisible scene graph node, a `Object3D` called `earthOrbit` -and added both the `earthMesh` and the `moonMesh` to it. The new scene graph looks like -this. - -<img src="resources/images/scenegraph-sun-earth-moon.svg" align="center"> - -and here's that - -{{{example url="../threejs-scenegraph-sun-earth-moon.html" }}} - -You can see the moon follows the spirograph pattern shown at the top -of this article but we didn't have to manually compute it. We just -setup our scene graph to do it for us. - -It is often useful to draw something to visualize the nodes in the scene graph. -Three.js has some helpful ummmm, helpers to ummm, ... help with this. - -One is called an `AxesHelper`. It draws 3 lines representing the local -<span style="color:red">X</span>, -<span style="color:green">Y</span>, and -<span style="color:blue">Z</span> axes. Let's add one to every node we -created. - -``` -// add an AxesHelper to each node -objects.forEach((node) => { - const axes = new THREE.AxesHelper(); - axes.material.depthTest = false; - axes.renderOrder = 1; - node.add(axes); -}); -``` - -On our case we want the axes to appear even though they are inside the spheres. -To do this we set their material's `depthTest` to false which means they will -not check to see if they are drawing behind something else. We also -set their `renderOrder` to 1 (the default is 0) so that they get drawn after -all the spheres. Otherwise a sphere might draw over them and cover them up. - -{{{example url="../threejs-scenegraph-sun-earth-moon-axes.html" }}} - -We can see the -<span style="color:red">x (red)</span> and -<span style="color:blue">z (blue)</span> axes. Since we are looking -straight down and each of our objects is only rotating around its -y axis we don't see much of the <span style="color:green">y (green)</span> axes. - -It might be hard to see some of them as there are 2 pairs of overlapping axes. Both the `sunMesh` -and the `solarSystem` are at the same position. Similarly the `earthMesh` and -`earthOrbit` are at the same position. Let's add some simple controls to allow us -to turn them on/off for each node. -While we're at it let's also add another helper called the `GridHelper`. It -makes a 2D grid on the X,Z plane. By default the grid is 10x10 units. - -We're also going to use [dat.GUI](https://github.com/dataarts/dat.gui) which is -a UI library that is very popular with three.js projects. dat.GUI takes an -object and a property name on that object and based on the type of the property -automatically makes a UI to manipulate that property. - -We want to make both a `GridHelper` and an `AxesHelper` for each node. We need -a label for each node so we'll get rid of the old loop and switch to calling -some function to add the helpers for each node - -``` --// add an AxesHelper to each node --objects.forEach((node) => { -- const axes = new THREE.AxesHelper(); -- axes.material.depthTest = false; -- axes.renderOrder = 1; -- node.add(axes); --}); - -+function makeAxisGrid(node, label, units) { -+ const helper = new AxisGridHelper(node, units); -+ gui.add(helper, 'visible').name(label); -+} -+ -+makeAxisGrid(solarSystem, 'solarSystem', 25); -+makeAxisGrid(sunMesh, 'sunMesh'); -+makeAxisGrid(earthOrbit, 'earthOrbit'); -+makeAxisGrid(earthMesh, 'earthMesh'); -+makeAxisGrid(moonMesh, 'moonMesh'); -``` - -`makeAxisGrid` makes a `AxisGridHelper` which is class we'll create -to make dat.GUI happy. Like it says above dat.GUI -will automagically make a UI that manipulates the named property -of some object. It will create a different UI depending on the type -of property. We want it to create a checkbox so we need to specify -a `bool` property. But, we want both the axes and the grid -to appear/disappear based on a single property so we'll make a class -that has a getter and setter for a property. That way we can let dat.GUI -think it's manipulating a single property but internally we can set -the visible property of both the `AxesHelper` and `GridHelper` for a node. - -``` -// Turns both axes and grid visible on/off -// dat.GUI requires a property that returns a bool -// to decide to make a checkbox so we make a setter -// can getter for `visible` which we can tell dat.GUI -// to look at. -class AxisGridHelper { - constructor(node, units = 10) { - const axes = new THREE.AxesHelper(); - axes.material.depthTest = false; - axes.renderOrder = 2; // after the grid - node.add(axes); - - const grid = new THREE.GridHelper(units, units); - grid.material.depthTest = false; - grid.renderOrder = 1; - node.add(grid); - - this.grid = grid; - this.axes = axes; - this.visible = false; - } - get visible() { - return this._visible; - } - set visible(v) { - this._visible = v; - this.grid.visible = v; - this.axes.visible = v; - } -} -``` - -One thing to notice is we set the `renderOrder` of the `AxesHelper` -to 2 and for the `GridHelper` to 1 so that the axes get drawn after the grid. -Otherwise the grid might overwrite the axes. - -{{{example url="../threejs-scenegraph-sun-earth-moon-axes-grids.html" }}} - -Turn on the `solarSystem` and you'll see how the earth is exactly 10 -units out from the center just like we set above. You can see how the -earth is in the *local space* of the `solarSystem`. Similary if you -turn on the `earthOrbit` you'll see how the moon is exactly 2 units -from the center of the *local space* of the `earthOrbit`. - -A few more examples of scene graphs. An automobile in a simple game world might have a scene graph like this - -<img src="resources/images/scenegraph-car.svg" align="center"> - -If you move the car's body all the wheels will move with it. If you wanted the body -to bounce separate from the wheels you might parent the body and the wheels to a "frame" node -that represents the car's frame. - -Another example is a human in a game world. - -<img src="resources/images/scenegraph-human.svg" align="center"> - -You can see the scene graph gets pretty complex for a human. In fact -that scene graph above is simplified. For example you might extend it -to cover the every finger (at least another 28 nodes) and every toe -(yet another 28 nodes) plus ones for the and jaw, the eyes and maybe more. - -I hope this gives some idea of how scene graphs work and how you might use them. -Making `Object3D` nodes and parenting things to them is an important step to using -a 3D engine like three.js well. Often it might seem like some complex math is necessary -to make something move and rotate the way you want. For example without a scene graph -computing the motion of the moon or where to put the wheels of the car relative to its -body would be very complicated but using a scene graph it becomes much easier. - -[Next up we'll go over materials and lights](threejs-materials-and-lights.html). \ No newline at end of file
true
Other
mrdoob
three.js
fd937afcf5de381e9e015faacf0df9a2be12a744.json
fix example link
threejs/lessons/threejs-scenegraph.md
@@ -355,7 +355,7 @@ One thing to notice is we set the `renderOrder` of the `AxesHelper` to 2 and for the `GridHelper` to 1 so that the axes get drawn after the grid. Otherwise the grid might overwrite the axes. -{{{example url="../threejs-scenegraph-sun-earth-moon-axes.html" }}} +{{{example url="../threejs-scenegraph-sun-earth-moon-axes-grids.html" }}} Turn on the `solarSystem` and you'll see how the earth is exactly 10 units out from the center just like we set above. You can see how the
false
Other
mrdoob
three.js
fae0c80fd5b93c8d0b987540c5c7c3dfdd7c3a64.json
move camera out
threejs/threejs-scenegraph-sun-earth.html
@@ -32,7 +32,7 @@ const zNear = 0.1; const zFar = 1000; const camera = new THREE.PerspectiveCamera(fov, aspect, zNear, zFar); - camera.position.set(0, 50, 0); + camera.position.set(0, 150, 0); camera.up.set(0, 0, 1); camera.lookAt(0, 0, 0);
false
Other
mrdoob
three.js
bc4281e4f3603107f483313689551466b4c7958e.json
remove border from diagrams
build/templates/diagram.template
@@ -1,5 +1,5 @@ <div class="threejs_diagram_container"> - <iframe class="threejs_example {{className}}" style="width: {{width}}px; height: {{height}}px;" src="{{{examplePath}}}{{{url}}}"></iframe> + <iframe class="threejs_diagram {{className}}" style="width: {{width}}px; height: {{height}}px;" src="{{{examplePath}}}{{{url}}}"></iframe> {{#caption}} <div class="threejs_center">{{{../caption}}}</div> {{/caption}}
true
Other
mrdoob
three.js
bc4281e4f3603107f483313689551466b4c7958e.json
remove border from diagrams
threejs/lessons/resources/lesson.css
@@ -228,11 +228,13 @@ iframe { iframe.body { height: 100vh; } -iframe.threejs_example { +iframe.threejs_example, iframe.threejs_diagram { border: none; margin-left: auto; margin-right: auto; display: block; +} +iframe.threejs_example { border: 1px solid black; } iframe.noborder {
true
Other
mrdoob
three.js
0f7fc620572415797d60e1c7477466eed77b1e65.json
add comment about scrolling console issues
threejs/resources/threejs-lessons-helper.js
@@ -172,6 +172,12 @@ // any random iframe control to bring itself into view against // the parent's wishes. // + // note that even if we used a solution (which is to manually set + // scrollTop) there's a UI issue that if the user manaully scrolls + // we want to stop scrolling automatically and if they move back + // to the bottom we want to pick up scrolling automatically. + // Kind of a PITA so TBD + // // div.scrollIntoView(); }
false
Other
mrdoob
three.js
af91ad963f646d6ad63015a09034424b6f2fdd07.json
Remove unnecessary line from CubeCamera (#23908) * removed unnecessary line from CubeCamera * fixed linter warnings
src/cameras/CubeCamera.js
@@ -1,4 +1,4 @@ -import { LinearEncoding, NoToneMapping } from '../constants.js'; +import { NoToneMapping } from '../constants.js'; import { Object3D } from '../core/Object3D.js'; import { Vector3 } from '../math/Vector3.js'; import { PerspectiveCamera } from './PerspectiveCamera.js'; @@ -74,7 +74,6 @@ class CubeCamera extends Object3D { const currentToneMapping = renderer.toneMapping; const currentXrEnabled = renderer.xr.enabled; - renderer.outputEncoding = LinearEncoding; renderer.toneMapping = NoToneMapping; renderer.xr.enabled = false;
false
Other
mrdoob
three.js
36706f6ada911c182191374c5c6877c7e4e96d28.json
update compositingAlphaMode (#23827)
examples/jsm/renderers/webgpu/WebGPURenderer.js
@@ -172,7 +172,7 @@ class WebGPURenderer { context.configure( { device: device, format: GPUTextureFormat.BGRA8Unorm, // this is the only valid context format right now (r121) - compositingAlphaMode: 'opaque' + compositingAlphaMode: 'premultiplied' } ); this._adapter = adapter; @@ -957,6 +957,7 @@ class WebGPURenderer { device: device, format: GPUTextureFormat.BGRA8Unorm, usage: GPUTextureUsage.RENDER_ATTACHMENT, + compositingAlphaMode: 'premultiplied', size: { width: Math.floor( this._width * this._pixelRatio ), height: Math.floor( this._height * this._pixelRatio ),
false
Other
mrdoob
three.js
564d38a4318b4c27f7346cc6cec5fd2ecf24d379.json
Fix typos in custom geometry article
threejs/lessons/threejs-custom-geometry.md
@@ -5,15 +5,15 @@ A [previous article](threejs-primitives.html) gave a tour of the various built in primitives included in THREE.js. In this article we'll cover making our own geometry. -Just to be clear, if you are serious about making 3D content +Just to be clear, if you are serious about making 3D content, the most common way is to use a 3D modeling package like -[blender](https://blender.org), +[Blender](https://blender.org), [Maya](https://www.autodesk.com/products/maya/overview), [3D Studio Max](https://www.autodesk.com/products/3ds-max/overview), [Cinema4D](https://www.maxon.net/en-us/), etc... You'd build a model and then export to [gLTF](threejs-load-gltf.html) or [.obj](threejs-load-obj.html) and load them up. -Which ever one you choose expect to spend 2 or 3 weeks going through +Whichever one you choose, expect to spend 2 or 3 weeks going through their respective tutorials as all of them have a learning curve to be useful. @@ -24,7 +24,7 @@ First let's just make a cube. Even though three.js already provides us with `BoxGeometry` and `BoxBufferGeometry` a cube is easy to understand so let's start there. -There are 2 ways to make custom geometry in THREE.js one +There are 2 ways to make custom geometry in THREE.js. One is with the `Geometry` class, the other is `BufferGeometry`. Each has their advantages. `Geometry` is arguably easier to use but slower and uses more memory. For few 1000s triangles @@ -38,7 +38,7 @@ consider using `BufferGeometry`. Note when I say `Geometry` is slower I mean it is slower to start and slower to modify but it is not slower to draw so -if you're not planning on modifying your geometry then +if you're not planning on modifying your geometry then as long as it's not too large there will only be slightly more delay for your program to start using `Geometry` vs using `BufferGeometry`. We'll go over both eventually. For now @@ -211,10 +211,10 @@ and we need to tell the material to use vertex colors To use lighting we need normals. Normals are vectors that specify direction. Just like the colors we can specify a normal for the face by setting the `normal` -property on each face with +property on each face with ```js -face.normal = new THREE.Vector3(...)` +face.normal = new THREE.Vector3(...) ``` or we can specify a normal for each vertex by setting the `vertexNormals` @@ -256,13 +256,13 @@ vertex normals for a smoother look by calling `Geometry.computeVertexNormals` +geometry.computeVertexNormals(); ``` -Unfortunately a cube is not a good candidate for vertex normals since it +Unfortunately a cube is not a good candidate for vertex normals since it means each vertex gets its normal from the -normals of all the faces it shares. +normals of all the faces it shares. {{{example url="../threejs-custom-geometry-cube-vertex-normals.html" }}} -Adding texture coordinates, sometimes called UVs, is done via an array of +Adding texture coordinates, sometimes called UVs, is done via an array of layers of parallel arrays to the `faces` array which is set via `Geometry.faceVertexUvs`. For our cube we could do something like @@ -315,7 +315,7 @@ function makeInstance(geometry, color, x) { {{{example url="../threejs-custom-geometry-cube-texcoords.html" }}} -Putting that all together lets make a simple heightmap based +Putting that all together, let's make a simple heightmap based terrain mesh. A heightmap based terrain is where you have a 2D array of heights @@ -325,7 +325,7 @@ It's 64x64 pixels <div class="threejs_center"><img src="../resources/images/heightmap-64x64.png" style="width: 512px; image-rendering: pixelated;"></div> -We'll load that and then generate a heightmap mesh from it. +We'll load that and then generate a heightmap mesh from it. We can use the `ImageLoader` to load the image. ```js @@ -353,7 +353,7 @@ from the image For each cell we'll generate 5 vertices. One for each corner of the cell and one at the center point of the cell with the average height of the 4 -corner heights. +corner heights. ```js const cellsAcross = width - 1; @@ -401,13 +401,13 @@ We'll then make 4 triangles from those 5 vertices ```js // create 4 triangles geometry.faces.push( - new THREE.Face3(ndx , ndx + 4, ndx + 1), + new THREE.Face3(ndx + 0, ndx + 4, ndx + 1), new THREE.Face3(ndx + 1, ndx + 4, ndx + 3), new THREE.Face3(ndx + 3, ndx + 4, ndx + 2), new THREE.Face3(ndx + 2, ndx + 4, ndx + 0), ); - // add the texture coordinates for each vertex of each face. + // add the texture coordinates for each vertex of each face const u0 = x / cellsAcross; const v0 = z / cellsAcross; const u1 = (x + 1) / cellsDeep; @@ -490,4 +490,4 @@ and we deleted the code related to spinning the cubes. I hope that was a useful instruction to making your own geometry using `Geometry`. -In [another article](threejs-custom-buffergeometry.html) we'll go over `BufferGeometry`. \ No newline at end of file +In [another article](threejs-custom-buffergeometry.html) we'll go over `BufferGeometry`.
false
Other
mrdoob
three.js
ea3e339568061152db716b14582be519988842c0.json
Fix typos in render targets article
threejs/lessons/threejs-rendertargets.md
@@ -6,7 +6,7 @@ After you render to it you can use that texture like any other texture. Let's make a simple example. We'll start with an example from [the article on responsiveness](threejs-responsive.html). -Rendering to a render target just almost exactly the same as normal rendering. First we create a `WebGLRenderTarget`. +Rendering to a render target is almost exactly the same as normal rendering. First we create a `WebGLRenderTarget`. ```js const rtWidth = 512; @@ -64,7 +64,7 @@ function makeInstance(geometry, color, x) { ]; ``` -The `Scene` and `Camera` from previous article are still there. We'll use them to render to the canvas. +The `Scene` and `Camera` from the previous article are still there. We'll use them to render to the canvas. We just need to add stuff to render. Let's add a cube that uses the render target's texture. @@ -120,7 +120,7 @@ Render target are used for all kinds of things. Shadows use a render target. [Pi A few notes about using `WebGLRenderTarget`. -* By default `WebGLRenderTarget` creates 2 textures. A color texture and a depth/stencil texture. If you don't need the depth or stencil textures you can request it not create them by passing in options. Example: +* By default `WebGLRenderTarget` creates 2 textures. A color texture and a depth/stencil texture. If you don't need the depth or stencil textures you can request to not create them by passing in options. Example: const rt = new THREE.WebGLRenderTarget(width, height, { depthBuffer: false, @@ -133,7 +133,7 @@ A few notes about using `WebGLRenderTarget`. function render(time) { time *= 0.001; - + if (resizeRendererToDisplaySize(renderer)) { const canvas = renderer.domElement; camera.aspect = canvas.clientWidth / canvas.clientHeight;
false
Other
mrdoob
three.js
8be8bef50b28d98ee558b9f0da75041b6caaa32c.json
Fix typos in fog article
threejs/lessons/threejs-fog.md
@@ -60,10 +60,10 @@ past that distance. </div> It's important to note that the fog is applied to *things that are rendered*. -It is part of the calculation of each pixel of the color of the object. -What that means is if you want your scene to fade to a certain color you -need to set the fog **and** the background color to the same color. -The background color is set using the +It is part of the calculation of each pixel of the color of the object. +What that means is if you want your scene to fade to a certain color you +need to set the fog **and** the background color to the same color. +The background color is set using the [`scene.background`](Scene.background) property. To pick a background color you attach a `THREE.Color` to it. For example @@ -105,7 +105,7 @@ will fade out right around their center. {{{example url="../threejs-fog.html" }}} -Let's add an interface so we can adjust the fog. Again we'll use +Let's add an interface so we can adjust the fog. Again we'll use [dat.GUI](https://github.com/dataarts/dat.gui). dat.GUI takes an object and a property and automagically makes an interface for that type of property. We could just simply let it manipulate @@ -155,7 +155,7 @@ We can then add it like this } ``` -The `near` and `far` parameter set the minimum and maximum values +The `near` and `far` parameters set the minimum and maximum values for adjusting the fog. They are set when we setup the camera. The `.listen()` at the end of the last 2 lines tells dat.GUI to *listen* @@ -168,7 +168,7 @@ mentioned above we need to keep both the fog color and the background color in sync. So, let's add another *virtual* property to our helper that will set both colors when dat.GUI manipulates it. -dat.GUI can manipulate colors in 4 ways, as a CSS 6 digit hex string (eg: `#112233`). As an hue, saturation, value, object (eg: `{h: 60, s: 1, v: }`). +dat.GUI can manipulate colors in 4 ways, as a CSS 6 digit hex string (eg: `#112233`). As an hue, saturation, value, object (eg: `{h: 60, s: 1, v: }`). As an RGB array (eg: `[255, 128, 64]`). Or, as an RGBA array (eg: `[127, 200, 75, 0.3]`). It's easiest for our purpose to use the hex string version since that way @@ -242,15 +242,15 @@ for most materials. As an example of why you might want to turn the fog off, imagine you're making a 3D vehicle simulator with a view from the driver's seat or cockpit. You probably want the fog off for everything inside the vehicle when -viewing from inside the vehicle. +viewing from inside the vehicle. A better example might be a house and thick fog outside house. Let's say the fog is set to start 2 meters away (near = 2) and completely fogged out at 4 meters (far = 4). Rooms are longer than 2 meters and the house is probably longer than 4 meters so you need to set the materials for the inside of the house to not apply fog otherwise when standing inside the -house looking outside the wall at the far end of the room will look +house looking outside the wall at the far end of the room will look like it's in the fog. <div class="spread"> @@ -261,7 +261,7 @@ like it's in the fog. </div> Notice the walls and ceiling at the far end of the room are getting fog applied. -By turing fog of on the materials for the house we can fix that issue. +By turning fog off on the materials for the house we can fix that issue. <div class="spread"> <div>
false
Other
mrdoob
three.js
d69010e1b87a1ec24b50aec3a1ae2b5fac8c0567.json
Fix typos in shadows article
threejs/lessons/threejs-shadows.md
@@ -4,24 +4,24 @@ Description: Shadows in Three.js This article is part of a series of articles about three.js. The first article is [three.js fundamentals](threejs-fundamentals.html). If you haven't read that yet and you're new to three.js you might want to -consider starting there. The +consider starting there. The [previous article was about cameras](threejs-cameras.html) which is important to have read before you read this article as well as the [article before that one about lights](threejs-lights.html). Shadows on computers can be a complicated topic. There are various solutions and all of them have tradeoffs including the solutions -available in three.js +available in three.js. Three.js by default uses *shadow maps*. The way a shadow map works is, *for every light that casts shadows all objects marked to cast shadows are rendered from the point of view of the light*. **READ THAT -AGAIN!** and let it sink in. +AGAIN!** and let it sink in. In other words, if you have 20 objects, and 5 lights, and all 20 objects are casting shadows and all 5 lights are casting shadows then your entire scene will be drawn 6 times. All 20 objects -will be drawn for light #1, then all 20 objects will be drawn for +will be drawn for light #1, then all 20 objects will be drawn for light #2, then #3, etc and finally the actual scene will be drawn using data from the first 5 renders. @@ -39,7 +39,7 @@ lighting or static lighting hints but at least it's fast. We'll cover both of those in another article. Another solution is to use fake shadows. Make a plane, put a grayscale -texture in the plane that approximates a shadow, +texture in the plane that approximates a shadow, draw it above the ground below your object. For example let's use this texture as a fake shadow @@ -86,7 +86,7 @@ a `MeshBasicMaterial` as we don't need lighting for the ground. Note we're setting the color to `1.5, 1.5, 1.5`. This will multiply the checkerboard texture's colors by 1.5, 1.5, 1.5. Since the texture's colors are 0x808080 and 0xC0C0C0 -which is medium gray and light gray, multiplying them by 1.5 will give is a white and +which is medium gray and light gray, multiplying them by 1.5 will give us a white and light grey checkerboard. Let's load the shadow texture @@ -120,7 +120,7 @@ const shadowGeo = new THREE.PlaneBufferGeometry(planeSize, planeSize); Now we'll make a bunch of spheres. For each sphere we'll create a `base` `THREE.Object3D` and we'll make both the shadow plane mesh and the sphere mesh children of the base. That way if we move the base both the sphere and the shadow -will move. We need to put the shadow slightly above the ground to prevent z-fighting. +will move. We need to put the shadow slightly above the ground to prevent z-fighting. We also set `depthWrite` to false so that the shadows don't mess each other up. We'll go over both of these issues in [another article](threejs-transparency.html). The shadow is a `MeshBasicMaterial` because it doesn't need lighting. @@ -132,7 +132,7 @@ the shadow mesh and the initial y position of each sphere. ```js const numSpheres = 15; for (let i = 0; i < numSpheres; ++i) { - // make a base for the shadow and the sphere. + // make a base for the shadow and the sphere // so they move together. const base = new THREE.Object3D(); scene.add(base); @@ -196,7 +196,7 @@ The other is a `DirectionalLight` so the spheres get some defintion It would render as is but let's animate there spheres. For each sphere, shadow, base set we move the base in the xz plane, we move the sphere up and down using `Math.abs(Math.sin(time))` -which gives us a bouncy animation. And, we also set the shadow material's +which gives us a bouncy animation. And, we also set the shadow material's opacity so that as each sphere goes higher its shadow fades out. ```js @@ -211,7 +211,7 @@ function render(time) { // u is a value that goes from 0 to 1 as we iterate the spheres const u = ndx / sphereShadowBases.length; - // compute a position for there base. This will move + // compute a position for the base. This will move // both the sphere and its shadow const speed = time * .2; const angle = speed + u * Math.PI * 2 * (ndx % 1 ? 1 : -1); @@ -236,15 +236,15 @@ And here's 15 kind of bouncing balls. In some apps it's common to use a round or oval shadow for everything but of course you could also use different shaped shadow textures. You might also give the shadow a harder edge. A good example of using this type -of shadow is [Animal Crossing Pocket Camp](https://www.google.com/search?tbm=isch&q=animal+crossing+pocket+camp+screenshots) +of shadow is [Animal Crossing Pocket Camp](https://www.google.com/search?tbm=isch&q=animal+crossing+pocket+camp+screenshots) where you can see each character has a simple round shadow. It's effective and cheap. -[Monument Valley](https://www.google.com/search?q=monument+valley+screenshots&tbm=isch) +[Monument Valley](https://www.google.com/search?q=monument+valley+screenshots&tbm=isch) appears to also use this kind of shadow for the main character. -So, moving on to shadow maps, there are 3 lights with can cast shadows. The `DirectionalLight`, +So, moving on to shadow maps, there are 3 lights which can cast shadows. The `DirectionalLight`, the `PointLight`, and the `SpotLight`. -Let's start with the `DirectionaLight` with helper example from [the lights article](threejs-lights.html). +Let's start with the `DirectionaLight` with the helper example from [the lights article](threejs-lights.html). The first thing we need to do is turn on shadows in the renderer. @@ -314,10 +314,10 @@ what's inside the light's shadow camera box is where shadows are drawn. We can adjust the size of that box by adjusting the light's shadow camera. -Let's add some GUI setting to adjust the light's shadow camera box. Since a -`DirectionalLight` represents light all going in a parallel direction the +Let's add some GUI setting to adjust the light's shadow camera box. Since a +`DirectionalLight` represents light all going in a parallel direction, the `DirectionalLight` uses an `OrthographicCamera` for its shadow camera. -We went over how an `OrthographicCamera` works in [the previous article about cameras.](threejs-cameras.html). +We went over how an `OrthographicCamera` works in [the previous article about cameras](threejs-cameras.html). Recall an `OrthographicCamera` defines its box or *view frustum* by its `left`, `right`, `top`, `bottom`, `near`, `far`, @@ -398,19 +398,19 @@ and you might see something like this <div class="threejs_center"><img src="resources/images/low-res-shadow-map.png" style="width: 369px"></div> -What's going on with these low-res shadows! +What's going on with these low-res shadows?! -This issue is yet another shadow related setting to be aware of. -Shadow maps are textures the shadows get drawn into. +This issue is yet another shadow related setting to be aware of. +Shadow maps are textures the shadows get drawn into. Those textures have a size. The shadow camera's area we set above is stretched -across that size. That means the larger area you set the more blocky your shadows will +across that size. That means the larger area you set, the more blocky your shadows will be. You can set the resolution of the shadow map's texture by setting `light.shadow.mapSize.width` and `light.shadow.mapSize.height`. They default to 512x512. The larger you make them the more memory they take and the slower they are to compute so you want to set them as small as you can and still make your scene work. The same is true with the -light's shadow camera area. Smaller means better looking shadows so make the area as small as you +light's shadow camera area. Smaller means better looking shadows so make the area as small as you can and still cover your scene. Be aware that each user's machine has a maximum texture size allowed which is available on the renderer as [`renderer.capabilities.maxTextureSize`](WebGLRenderer.capabilities). @@ -456,8 +456,8 @@ each one pointing to the face of a cube around the light. This means `PointLight` shadows are much slower since the entire scene must be drawn 6 times, one for each direction. -Let's put a box around our scene so we can see shadows on the walls -and ceiling. We'll set the material's `side` property to `THREE.BackSide` +Let's put a box around our scene so we can see shadows on the walls +and ceiling. We'll set the material's `side` property to `THREE.BackSide` so we render the inside of the box instead of the outside. Like the floor we'll set it only to receive shadows. Also we'll set the position of the box so its bottom is slightly below the floor so the floor and the bottom
false
Other
mrdoob
three.js
8b458550e9dd2befe74f5893a389b77a5b8abfc0.json
Fix typos in cameras article
threejs/lessons/threejs-cameras.md
@@ -5,14 +5,14 @@ This article is one in a series of articles about three.js. The first article was [about fundamentals](threejs-fundamentals.html). If you haven't read that yet you might want to start there. -Let's talk about Cameras in three.js. We covered some of this in the [first article](threejs-fundamentals.html) but we'll cover it in more detail here. +Let's talk about cameras in three.js. We covered some of this in the [first article](threejs-fundamentals.html) but we'll cover it in more detail here. The most common camera in three.js and the one we've been using up to this point is -the `PerspectiveCamera`. It gives a 3d view where things in the distance appear +the `PerspectiveCamera`. It gives a 3d view where things in the distance appear smaller than things up close. The `PerspectiveCamera` defines a *frustum*. [A *frustum* is a solid pyramid shape with -the tip cut off](https://en.wikipedia.org/wiki/Frustum). +the tip cut off](https://en.wikipedia.org/wiki/Frustum). By name of a solid I mean for example a cube, a cone, a sphere, a cylinder, and a frustum are all names of different kinds of solids. @@ -29,19 +29,19 @@ I only point that out because I didn't know if for years. Some book or page woul shape made those descriptions suddenly make more sense &#128517; A `PerspectiveCamera` defines its frustum based on 4 properties. `near` defines where the -front of the frustum starts. `far` defines where it ends. `fov`, the field of view, defines -how tall the front and back of the frustum are by computing the correct height to get -the specified field of view at `near` units from the camera. The `aspect` defines how -wide the front and back of the frustum are. The width of the frustum is just the height +front of the frustum starts. `far` defines where it ends. `fov`, the field of view, defines +how tall the front and back of the frustum are by computing the correct height to get +the specified field of view at `near` units from the camera. The `aspect` defines how +wide the front and back of the frustum are. The width of the frustum is just the height multiplied by the aspect. <img src="resources/frustum-3d.svg" width="500" class="threejs_center"/> Let's use the scene from [the previous article](threejs-lights.html) that has a ground -plane, a sphere, and a cube and make it so we can adjust the camera's settings +plane, a sphere, and a cube and make it so we can adjust the camera's settings. -To do that we'll make a `MinMaxGUIHelper` for the `near` and `far` settings so `far` -is always greater than `near`. It will have `min` and `max` properties that dat.GUI +To do that we'll make a `MinMaxGUIHelper` for the `near` and `far` settings so `far` +is always greater than `near`. It will have `min` and `max` properties that dat.GUI will adjust. When adjusted they'll set the 2 properties we specify. ```js @@ -83,13 +83,13 @@ gui.add(minMaxGUIHelper, 'min', 0.1, 50, 0.1).name('near').onChange(updateCamera gui.add(minMaxGUIHelper, 'max', 0.1, 50, 0.1).name('far').onChange(updateCamera); ``` -Anytime the camera's settings change we need to call the camera's +Anytime the camera's settings change we need to call the camera's [`updateProjectionMatrix`](PerspectiveCamera.updateProjectionMatrix) function so we made a function called `updateCamera` add passed it to dat.GUI to call it when things change. {{{example url="../threejs-cameras-perspective.html" }}} -You can just the values and see how they work. Note we didn't make `aspect` setable since +You can adjust the values and see how they work. Note we didn't make `aspect` settable since it's taken from the size of the window so if you want to adjust the aspect open the example in a new window and then size the window. @@ -144,7 +144,7 @@ scene.add(cameraHelper); Now let's look up the 2 view elements. ```js -const view1Elem = document.querySelector('#view1'); +const view1Elem = document.querySelector('#view1'); const view2Elem = document.querySelector('#view2'); ``` @@ -303,10 +303,10 @@ the frustum. This brings up the question, why not just set `near` to 0.0000000001 and `far` to 10000000000000 or something like that so you can just see everything? -The reason is your GPU only has so much precision to decide if something +The reason is your GPU only has so much precision to decide if something is in front or behind something else. That precision is spread out between `near` and `far`. Worse, by default the precision close the camera is detailed -and the precision far from the camera is course. The units use start with `near` +and the precision far from the camera is coarse. The units start with `near` and slowly expand as they approach `far`. Starting with the top example, let's change the code to insert 20 spheres in a @@ -359,7 +359,7 @@ Just in case the issue doesn't show on your machine here's what I see on mine <div class="threejs_center"><img src="resources/images/z-fighting.png" style="width: 570px;"></div> One solution is to tell three.js use to a different method to compute which -pixels are in front and which are behind. We can do that by enabling +pixels are in front and which are behind. We can do that by enabling `logarithmicDepthBuffer` when we create the `WebGLRenderer` ```js @@ -375,9 +375,9 @@ and with that it might work {{{example url="../threejs-cameras-logarithmic-depth-buffer.html" }}} If this didn't fix the issue for you then you've run into one reason why -you can't always use this solution. That reason is because only certain GPUs +you can't always use this solution. That reason is because only certain GPUs support it. As of September 2018 almost no mobile devices support this -solution where as most desktops do. +solution whereas most desktops do. Another reason not to choose this solution is it can be significantly slower than the standard solution. @@ -476,7 +476,7 @@ camera.far = 1; camera.zoom = 1; ``` -Or if we wanted the origin to be in the top left just like a +Or if we wanted the origin to be in the top left just like a 2D canvas we could use this ```js @@ -593,7 +593,7 @@ In the screenshot above you can see 1 view is a perspective view and 3 views are orthographic views. That's the fundamentals of cameras. We'll cover a few common ways to move cameras -in other articles. For now lets move on to [shadows](threejs-shadows.html). +in other articles. For now let's move on to [shadows](threejs-shadows.html). <canvas id="c"></canvas> <script src="../resources/threejs/r105/three.min.js"></script>
false
Other
mrdoob
three.js
37bf8a822f619ba33793ecc09bbaf62d8a7f0c8f.json
Fix typos in lights article
threejs/lessons/threejs-lights.md
@@ -4,10 +4,10 @@ Description: Setting up Lights This article is part of a series of articles about three.js. The first article is [three.js fundamentals](threejs-fundamentals.html). If you haven't read that yet and you're new to three.js you might want to -consider starting there. The +consider starting there. The [previous article was about textures](threejs-textures.html). -Let go over how to use the various kinds of lights in three. +Let's go over how to use the various kinds of lights in three. Starting with one of our previous samples let's update the camera. We'll set the field of view to 45 degrees, the far plane to 100 units, @@ -32,7 +32,7 @@ in our page +<script src="resources/threejs/r105/js/controls/OrbitControls.js"></script> ``` -Then we can use them. We pass the `OrbitControls` a camera to +Then we can use them. We pass the `OrbitControls` a camera to control and the DOM element to use to get input events ```js @@ -74,7 +74,7 @@ const repeats = planeSize / 2; texture.repeat.set(repeats, repeats); ``` -We then make a plane geometry, a material for the plane, and mesh +We then make a plane geometry, a material for the plane, and a mesh to insert it in the scene. Planes default to being in the XY plane but the ground is in the XZ plane so we rotate it. @@ -126,13 +126,13 @@ scene.add(light); ``` Let's also make it so we can adjust the light's parameters. -We'll use [dat.GUI](https://github.com/dataarts/dat.gui) again. +We'll use [dat.GUI](https://github.com/dataarts/dat.gui) again. To be able to adjust the color via dat.GUI we need a small helper that presents a property to dat.GUI that looks like a CSS hex color string (eg: `#FF8844`). Our helper will get the color from a named property, convert it to a hex string to offer to dat.GUI. When dat.GUI tries to set the helper's property we'll assign the result back to the light's -color. +color. Here's the helper: @@ -165,23 +165,23 @@ And here's the result Click and drag in the scene to *orbit* the camera. -Notice there is no defintion. The shapes are flat. The `AmbientLight` effectively -just multiply's the material's color by the light's color times the +Notice there is no definition. The shapes are flat. The `AmbientLight` effectively +just multiplies the material's color by the light's color times the intensity. color = materialColor * light.color * light.intensity; -That's it. It has no direction. +That's it. It has no direction. This style of ambient lighting is actually not all that useful as lighting as it's 100% even so other than changing the color of everything in the scene it doesn't look much like *lighting*. What it does help with is making the darks not too dark. ## `HemisphereLight` -Let's switch the code the a `HemisphereLight`. A `HemisphereLight` +Let's switch the code to a `HemisphereLight`. A `HemisphereLight` takes a sky color and a ground color and just multplies the -material's color between those 2 colors. The sky color if the +material's color between those 2 colors—the sky color if the surface of the object is pointing up and the ground color if the surface of the object is pointing down. @@ -255,14 +255,14 @@ of helper objects we can add to our scene to help visualize invisible parts of a scene. In this case we'll use the `DirectionalLightHelper` which will draw a plane, to represent the light, and a line from the light to the target. We just -pass it the light and add itd add it to the scene. +pass it the light and add it to the scene. ```js const helper = new THREE.DirectionalLightHelper(light); scene.add(helper); ``` -While we're at it lets make it so we can set both the position +While we're at it let's make it so we can set both the position of the light and the target. To do this we'll make a function that given a `Vector3` will adjust its `x`, `y`, and `z` properties using `dat.GUI`. @@ -306,7 +306,7 @@ Now we can move the light, and its target Orbit the camera and it gets easier to see. The plane represents a `DirectionalLight` because a directional -light computes light comming in one direction. There is no +light computes light coming in one direction. There is no *point* the light comes from, it's an infinite plane of light shooting out parallel rays of light. @@ -374,7 +374,7 @@ Notice when `distance` is > 0 how the light fades out. ## `SpotLight` -Spotlights are affectively a point light with a cone +Spotlights are effectively a point light with a cone attached where the light only shines inside the cone. There's actually 2 cones. An outer cone and an inner cone. Between the inner cone and the outer cone the @@ -400,7 +400,7 @@ scene.add(helper); ``` The spotlight's cone's angle is set with the [`angle`](Spotlight.angle) -property in radians. We'll use our `DegRadHelper` from the +property in radians. We'll use our `DegRadHelper` from the [texture article](threejs-textures.html) to present a UI in degrees. @@ -422,7 +422,7 @@ gui.add(light, 'penumbra', 0, 1, 0.01); {{{example url="../threejs-lights-spot-w-helper.html" }}} Notice with the default `penumbra` of 0 the spotlight has a very sharp edge -where as as you adjust the `penumbra` toward 1 edge blurs. +whereas as you adjust the `penumbra` toward 1 the edge blurs. It might be hard to see the *cone* of the spotlight. The reason is it's below the ground. Shorten the distance to around 5 and you'll see the open @@ -434,7 +434,7 @@ There's one more type of light, the `RectAreaLight`, which represents exactly what it sounds like, a rectangular area of light like a long fluorescent light or maybe a frosted sky light in a ceiling. -The `RectAreaLight` only works with the `MeshStandardMaterai` and the +The `RectAreaLight` only works with the `MeshStandardMaterial` and the `MeshPhysicalMaterial` so let's change all our materials to `MeshStandardMaterial` ```js @@ -498,7 +498,7 @@ scene.add(light); *light.add(helper); ``` -One thing to notice is that unlike the `DirectionalLight` and the `SpotLight` the +One thing to notice is that unlike the `DirectionalLight` and the `SpotLight`, the `RectAreaLight` does not use a target. It just uses its rotation. Another thing to notice is the helper needs to be a child of the light. It is not a child of the scene like other helpers. @@ -527,10 +527,10 @@ One thing we didn't cover is that there is a setting on the `WebGLRenderer` called `physicallyCorrectLights`. It effects how light falls off as distance from light. It only affects `PointLight` and `SpotLight`. `RectAreaLight` does this automatically. -For lights though the basic idea is you don't set a distance for them to fade out, -and you don't set `intensity`. Instead you set the [`power`](PointLight.power) of -the light in lumens and then three.js will use physics calculations like real lights. -The units of three.js in this case are meters and a 60w light bulb would have +For lights though the basic idea is you don't set a distance for them to fade out, +and you don't set `intensity`. Instead you set the [`power`](PointLight.power) of +the light in lumens and then three.js will use physics calculations like real lights. +The units of three.js in this case are meters and a 60w light bulb would have around 800 lumens. There's also a [`decay`](PointLight.decay) property. It should be set to `2` for realistic decay. @@ -566,9 +566,9 @@ gui.add(light, 'power', 0, 2000); {{{example url="../threejs-lights-point-physically-correct.html" }}} -It's important to note each light you add to scene slows down how fast +It's important to note each light you add to the scene slows down how fast three.js renders the scene so you should always try to use as few as -possible to achieve your goals. +possible to achieve your goals. Next up let's go over [dealing with cameras](threejs-cameras.html).
false
Other
mrdoob
three.js
45a32b784f787facb555062d0d263629b479eec0.json
Fix typos in texture article
threejs/lessons/threejs-textures.md
@@ -1,5 +1,5 @@ Title: Three.js Textures -Description: Using Textures in three.js +Description: Using textures in three.js This article is one in a series of articles about three.js. The first article was [about three.js fundamentals](threejs-fundamentals.html). @@ -8,22 +8,22 @@ If you haven't read that yet you might want to start there. Textures are a kind of large topic in Three.js and I'm not 100% sure at what level to explain them but I will try. -There are many topics and many of them inter-relate so it's hard to explain +There are many topics and many of them interrelate so it's hard to explain them all at once. Here's quick table of contents for this article. <ul> <li><a href="#hello">Hello Texture</a></li> -<li><a href="#six">6 Textures, a different one on each face of a cube</a></li> -<li><a href="#loading">Loading Textures</a></li> +<li><a href="#six">6 textures, a different one on each face of a cube</a></li> +<li><a href="#loading">Loading textures</a></li> <ul> - <li><a href="#easy">The Easy Way</a></li> + <li><a href="#easy">The easy way</a></li> <li><a href="#wait1">Waiting for a texture to load</a></li> <li><a href="#waitmany">Waiting for multiple textures to load</a></li> <li><a href="#cors">Loading textures from other origins</a></li> </ul> -<li><a href="#memory">Memory Usage</a></li> +<li><a href="#memory">Memory usage</a></li> <li><a href="#format">JPG vs PNG</a></li> -<li><a href="#filtering-and-mips">Filtering and Mips</a></li> +<li><a href="#filtering-and-mips">Filtering and mips</a></li> <li><a href="#uvmanipulation">Repeating, offseting, rotating, wrapping</a></li> </ul> @@ -56,7 +56,7 @@ Note that we're using `MeshBasicMaterial` so no need for any lights. ## <a name="six"></a> 6 Textures, a different one on each face of a cube -How about 6 textures, one on each face of a cube? +How about 6 textures, one on each face of a cube? <div class="threejs_center"> <div> @@ -95,31 +95,31 @@ It works! {{{example url="../threejs-textured-cube-6-textures.html" }}} -It should be noted though that by default the only Geometry that supports multiple +It should be noted though that by default the only geometry that supports multiple materials is the `BoxGeometry` and `BoxBufferGeometry`. For other cases you will need to build or load custom geometry and/or modify texture coordinates. It's far -more common to use a [Texture Atlas](https://en.wikipedia.org/wiki/Texture_atlas) +more common to use a [Texture Atlas](https://en.wikipedia.org/wiki/Texture_atlas) if you want to allow multiple images on a single geometry. What are texture coordinates? They are data added to each vertex of a piece of geometry -that specify what part of the texture corresponds to that specific vertex. +that specify what part of the texture corresponds to that specific vertex. We'll go over them when we start building custom geometry. ## <a name="loading"></a> Loading Textures ### <a name="easy"></a> The Easy Way -Most of the code on this site uses the easiest method of loading textures. -We create a `TextureLoader` and then call its [`load`](TextureLoader.load) method. +Most of the code on this site uses the easiest method of loading textures. +We create a `TextureLoader` and then call its [`load`](TextureLoader.load) method. This returns a `Texture` object. ```js const texture = loader.load('resources/images/flower-1.jpg'); ``` It's important to note that using this method our texture will be transparent until -the image is loaded asychronously by three.js at which point it will update the texture +the image is loaded asynchronously by three.js at which point it will update the texture with the downloaded image. This has the big advantage that we don't have to wait for the texture to load and our @@ -243,13 +243,13 @@ the loading bar. {{{example url="../threejs-textured-cube-wait-for-all-textures.html" }}} -## <a name="cors"></a> Loading textures from other origins. +## <a name="cors"></a> Loading textures from other origins To use images from other servers those servers need to send the correct headers. -If they don't you can not use the images in three.js and will get an error. +If they don't you cannot use the images in three.js and will get an error. If you run the server providing the images make sure it [sends the correct headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). -If you don't control the server hosting the images and it does not send the +If you don't control the server hosting the images and it does not send the permission headers then you can't use the images from that server. For example [imgur](https://imgur.com), [flickr](https://flickr.com), and @@ -259,38 +259,38 @@ hosted on their servers in three.js. Most other websites do not. ## <a name="memory"></a> Memory Usage Textures are often the part of a three.js app that use the most memory. It's important to understand -that *in general*, textures take `width * height * 4 * 1.33` bytes of memory. +that *in general*, textures take `width * height * 4 * 1.33` bytes of memory. Notice that says nothing about compression. I can make a .jpg image and set its compression super high. For example let's say I was making a scene of a house. Inside the house there is a table and I decide to put this wood texture on the top surface of the table <div class="threejs_center"><img class="border" src="resources/images/compressed-but-large-wood-texture.jpg" align="center" style="width: 300px"></div> -That image is only 157k so it will download relatively quickly but [it is actually -3024 x 3761 pixels in size](resources/images/compressed-but-large-wood-texture.jpg). +That image is only 157k so it will download relatively quickly but [it is actually +3024 x 3761 pixels in size](resources/images/compressed-but-large-wood-texture.jpg). Following the equation above that's 3024 * 3761 * 4 * 1.33 = 60505764.5 -That image will take **60 MEG OF MEMORY!** in three.js. +That image will take **60 MEG OF MEMORY!** in three.js. A few textures like that and you'll be out of memory. -I bring this up because it's important to know that using textures has a hidden cost. -In order for three.js to use the texture it has to hand it off to the GPU and the +I bring this up because it's important to know that using textures has a hidden cost. +In order for three.js to use the texture it has to hand it off to the GPU and the GPU *in general* requires the texture data to be uncompressed. -The moral of the story is make your textures small in dimensions not just small -in file size. Small in file size = fast to download. Small in dimesions = takes +The moral of the story is make your textures small in dimensions not just small +in file size. Small in file size = fast to download. Small in dimesions = takes less memory. How small should you make them? As small as you can and still look as good as you need them to look. ## <a name="format"></a> JPG vs PNG -This is pretty much the same as regular HTML in that JPGs have lossy compression, -PNGs have lossless compression so PNGs are generally slower to download. +This is pretty much the same as regular HTML in that JPGs have lossy compression, +PNGs have lossless compression so PNGs are generally slower to download. But, PNGs support transparency. PNGs are also probably the appropriate format -for non-image data like normal maps, and other kinds of non-image maps which we'll go over later. +for non-image data like normal maps, and other kinds of non-image maps which we'll go over later. It's important to remember that a JPG doesn't use less memory than a PNG in WebGL. See above. @@ -323,8 +323,8 @@ to make those 1 or 2 pixels. That would be a very slow operation. GPUs solve thi using mipmaps. Mips are copies of the texture, each one half as wide and half as tall as the previous -mip where the pixels have been blended to make the next smaller mip. Mips are created -until we get all the way to a 1x1 pixel mip. For the image above all of the mips would +mip where the pixels have been blended to make the next smaller mip. Mips are created +until we get all the way to a 1x1 pixel mip. For the image above all of the mips would end up being something like this <div class="threejs_center"><img src="resources/images/mipmap-low-res-enlarged.png" align="center"></div> @@ -333,7 +333,7 @@ Now, when the cube is drawn so small that it's only 1 or 2 pixels large the GPU to use just the smallest or next to smallest mip level to decide what color to make the tiny cube. -In three you can choose what happens both what happens when the texture is drawn +In three you can choose what happens both when the texture is drawn larger than its original size and what happens when it's drawn smaller than its original size. @@ -364,33 +364,33 @@ you set the [`texture.minFilter`](Texture.minFilter) property to one of 6 values * `THREE.NearestFilter` - same as above. Choose the closest pixel in the texture + same as above, choose the closest pixel in the texture * `THREE.LinearFilter` - same as above, Choose 4 pixels from the texture and blend them + same as above, choose 4 pixels from the texture and blend them * `THREE.NearestMipMapNearestFilter` - choose the appropriate mip then choose one pixel. + choose the appropriate mip then choose one pixel * `THREE.NearestMipMapLinearFilter` - choose 2 mips, choose one pixel from each, blend the 2 pixels. + choose 2 mips, choose one pixel from each, blend the 2 pixels * `THREE.LinearMipMapNearestFilter` - chose the appropriate mip then choose 4 pixels and blend them. + chose the appropriate mip then choose 4 pixels and blend them * `THREE.LinearMipMapLinearFilter` - choose 2 mips, choose 4 pixels from each and blend all 8 into 1 pixel. + choose 2 mips, choose 4 pixels from each and blend all 8 into 1 pixel Here's an example showing all 6 settings <div class="spread"> <div data-diagram="filterModes" style=" - height: 450px; + height: 450px; position: relative; "> <div style=" @@ -422,13 +422,13 @@ Here's an example showing all 6 settings One thing to notice is the top left and top middle using `NearestFilter` and `LinearFilter` don't use the mips. Because of that they flicker in the distance because the GPU is -picking pixels from the original texture. On the left just one pixel is chosen and +picking pixels from the original texture. On the left just one pixel is chosen and in the middle 4 are chosen and blended but it's not enough come up with a good representative color. The other 4 strips do better with the bottom right, `LinearMipMapLinearFilter` being best. If you click the picture above it will toggle between the texture we've been using above -and a texture where every mip level is a different color. +and a texture where every mip level is a different color. <div class="threejs_center"> <div data-texture-diagram="differentColoredMips"></div> @@ -461,15 +461,15 @@ They can be set to one of: * `THREE.ClampToEdgeWrapping` - The last pixel on each edge is repeated forever + the last pixel on each edge is repeated forever * `THREE.RepeatWrapping` - The texture is repeated + the texture is repeated * `THREE.MirroredRepeatWrapping` - The texture is mirrored and repeated. + the texture is mirrored and repeated For example to turn on wrapping in both directions: @@ -487,24 +487,24 @@ someTexture.repeat.set(timesToRepeatHorizontally, timesToRepeatVertically); ``` Offseting the texture can be done by setting the `offset` property. Textures -are offset with units where 1 unit = 1 texture size. On other words 0 = no offset +are offset with units where 1 unit = 1 texture size. On other words 0 = no offset and 1 = offset one full texture amount. ```js const xOffset = .5; // offset by half the texture -const yOffset = .25; // offset by 1/2 the texture -someTexture.offset.set(xOffset, yOffset);` +const yOffset = .25; // offset by 1/4 the texture +someTexture.offset.set(xOffset, yOffset); ``` -Rotating the texture can be set by setting `rotation` property in radians +Rotating the texture can be set by setting the `rotation` property in radians as well as the `center` property for choosing the center of rotation. It defaults to 0,0 which rotates from the bottom left corner. Like offset these units are in texture size so setting them to `.5, .5` would rotate around the center of the texture. ```js someTexture.center.set(.5, .5); -someTexture.rotation = THREE.Math.degToRad(45); +someTexture.rotation = THREE.Math.degToRad(45); ``` Let's modify the top sample above to play with these values @@ -594,7 +594,7 @@ gui.add(new DegRadHelper(texture, 'rotation'), 'value', -360, 360) ``` The last thing to note about the example is that if you change `wrapS` or -`wrapT` on the texture you must also set [`texture.needsUpdate`](Texture.needsUpdate) +`wrapT` on the texture you must also set [`texture.needsUpdate`](Texture.needsUpdate) so three.js knows to apply those settings. The other settings are automatically applied. {{{example url="../threejs-textured-cube-adjust.html" }}} @@ -606,7 +606,7 @@ to materials. For now let's move on to [lights](threejs-lights.html). <!-- -alpha +alpha ao env light @@ -630,7 +630,7 @@ roughness font-family: monospace; font-size: small; text-shadow: - -1px -1px 0 #000, + -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
false