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 | 941f0233db0d0dc42ddc0c5900abadbaa247769d.json | Fix typos in setup article | threejs/lessons/threejs-setup.md | @@ -7,16 +7,16 @@ If you haven't read that yet you might want to start there.
Before we go any further we need to talk about setting up your
computer to do developement. In particular, for security reasons,
-WebGL can not use images from your hard drive directly. That means
+WebGL cannot use images from your hard d... | false |
Other | mrdoob | three.js | eb6e93e132a47998171c5e2caf9b03ea001fcf15.json | Fix typos in materials article | threejs/lessons/threejs-materials.md | @@ -5,8 +5,8 @@ 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.
-
-Three.js provides several types of materials.
+
+Three.js provi... | false |
Other | mrdoob | three.js | 393bb5838e519dca89e1f9c9c67163db99a7d826.json | Fix typos in scene graph article | threejs/lessons/threejs-scenegraph.md | @@ -1,9 +1,9 @@
-Title: Three.js Scenegraph
+Title: Three.js Scene Graph
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](threejs-fundamentals.html). If
-you haven't read yet you might want to consider starting there.
+you ... | false |
Other | mrdoob | three.js | db03724dabebb84107fa85bc392d57212f5672aa.json | Fix typos in primitives article | threejs/lessons/threejs-primitives.md | @@ -10,9 +10,9 @@ 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
+for a globe or a bunch of boxes to draw a 3D graph. It's
especially common to use primitives to experim... | false |
Other | mrdoob | three.js | 4b441cc01d7ca92d99a304ce4a30470ec6048e51.json | Fix typos in responsive design article | threejs/lessons/threejs-responsive.md | @@ -11,18 +11,18 @@ 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
+example, a 3D editor with controls on the left, right, top, or
bottom is somet... | false |
Other | mrdoob | three.js | 23a43c854d5e8c2f76d8291d1f69ef43ca9831eb.json | Fix typos in fundamentals article | threejs/lessons/threejs-fundamentals.md | @@ -7,15 +7,15 @@ 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](https://webglfundamentals.org).
+[WebGL is a ver... | false |
Other | mrdoob | three.js | 2a8973489f88b80a42988ed9801de9e16126aa6b.json | handle css urls better | threejs/resources/editor.js | @@ -50,17 +50,19 @@ function getPrefix(url) {
}
function fixCSSLinks(url, source) {
- const cssUrlRE = /(url\()(.*?)(\))/g;
+ const cssUrlRE1 = /(url\(')(.*?)('\))/g;
+ const cssUrlRE2 = /(url\()(.*?)(\))/g;
const prefix = getPrefix(url);
function addPrefix(url) {
- return url.indexOf('://') < 0 ? (pr... | false |
Other | mrdoob | three.js | d0c06efc03bfcf0e2286d2b72e80355f5a1ef5b0.json | add react eslint support | .eslintrc.js | @@ -5,8 +5,12 @@ module.exports = {
},
"parserOptions": {
"ecmaVersion": 8,
+ "ecmaFeatures": {
+ "jsx": true
+ },
},
"plugins": [
+ "eslint-plugin-react",
"eslint-plugin-html",
"eslint-plugin-optional-comma-spacing",
"eslint-plugin-one-variable-per-var", | false |
Other | mrdoob | three.js | ee56e3f2eee08e59fe02d4640125e754547ecd72.json | add cleanup article | threejs/lessons/threejs-cleanup.md | @@ -0,0 +1,467 @@
+Title: Three.js Cleanup
+Description: How to use free memory used by Three.js
+
+Three.js apps often use lots of memory. A 3D model
+might be 1 to 20 meg memory for all of its vertices.
+A model might use many textures that even if they are
+compressed into jpg files they have to be expanded
+to thei... | true |
Other | mrdoob | three.js | ee56e3f2eee08e59fe02d4640125e754547ecd72.json | add cleanup article | threejs/lessons/toc.html | @@ -21,6 +21,7 @@
<li><a href="/threejs/lessons/threejs-indexed-textures.html">Using Indexed Textures for Picking and Color</a></li>
<li><a href="/threejs/lessons/threejs-canvas-textures.html">Using A Canvas for Dynamic Textures</a></li>
<li><a href="/threejs/lessons/threejs-billboards.html">Billboards a... | true |
Other | mrdoob | three.js | ee56e3f2eee08e59fe02d4640125e754547ecd72.json | add cleanup article | threejs/threejs-cleanup-loaded-files.html | @@ -0,0 +1,225 @@
+<!-- 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 - Cleanup Loaded Files</title>
+ <style>
+ body ... | true |
Other | mrdoob | three.js | ee56e3f2eee08e59fe02d4640125e754547ecd72.json | add cleanup article | threejs/threejs-cleanup-simple.html | @@ -0,0 +1,149 @@
+<!-- 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 - Cleanup</title>
+ <style>
+ body {
+ ma... | true |
Other | mrdoob | three.js | d31e2a9e40e4e2f121f687980ab33a715ad742b4.json | add leading space for h1,h2 ...
lower-contrast for dark mode text | threejs/lessons/resources/lesson.css | @@ -81,6 +81,22 @@ div[data-diagram] {
max-width: 700px;
width: calc(100% - 40px);
}
+.lesson-main>h1,
+.lesson-main>h2,
+.lesson-main>h3,
+.lesson-main>h4,
+.lesson-main>h5,
+.lesson-main>h6 {
+ margin-top: 1.66em;
+}
+.lesson-main>h1:first-child,
+.lesson-main>h2:first-child,
+.lesson-main>h3:first-chil... | false |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/lessons/threejs-offscreencanvas.md | @@ -0,0 +1,1133 @@
+Title: Three.js OffscreenCanvas
+Description: How to use three.js in a web worker
+
+[`OffscreenCanvas`](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas)
+is a relatively new browser feature currently only available in Chrome but apparently
+coming to other browsers. `OffscreenCanva... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/lessons/toc.html | @@ -31,6 +31,7 @@
<ul>
<li><a href="/threejs/lessons/threejs-optimize-lots-of-objects.html">Optimizing Lots of Objects</a></li>
<li><a href="/threejs/lessons/threejs-optimize-lots-of-objects-animated.html">Optimizing Lots of Objects Animated</a></li>
+ <li><a href="/threejs/lessons/threejs-offscreencanv... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/offscreencanvas-cubes.js | @@ -0,0 +1,110 @@
+'use strict';
+
+/* global importScripts, THREE */
+
+importScripts('resources/threejs/r103/three.min.js');
+
+const state = {
+ width: 300, // canvas default
+ height: 150, // canvas default
+};
+
+function main(data) {
+ const {canvas} = data;
+ const renderer = new THREE.WebGLRenderer({canv... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/offscreencanvas-worker-cubes.js | @@ -0,0 +1,24 @@
+'use strict';
+
+/* global importScripts, init, state */
+
+importScripts('resources/threejs/r103/three.min.js');
+importScripts('shared-cubes.js');
+
+function size(data) {
+ state.width = data.width;
+ state.height = data.height;
+}
+
+const handlers = {
+ init,
+ size,
+};
+
+self.onmessage = f... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/offscreencanvas-worker-orbitcontrols.js | @@ -0,0 +1,84 @@
+'use strict';
+
+/* global importScripts, init, THREE */
+
+importScripts('resources/threejs/r103/three.js');
+importScripts('resources/threejs/r103/js/controls/OrbitControls.js');
+importScripts('shared-orbitcontrols.js');
+
+function noop() {
+}
+
+class ElementProxyReceiver extends THREE.EventDispa... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/offscreencanvas-worker-picking.js | @@ -0,0 +1,30 @@
+'use strict';
+
+/* global importScripts, init, state, pickPosition */
+
+importScripts('resources/threejs/r103/three.min.js');
+importScripts('shared-picking.js');
+
+function size(data) {
+ state.width = data.width;
+ state.height = data.height;
+}
+
+function mouse(data) {
+ pickPosition.x = dat... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/resources/lessons-helper.js | @@ -370,15 +370,12 @@
* Gets a WebGL context.
* makes its backing store the size it is displayed.
* @param {HTMLCanvasElement} canvas a canvas element.
- * @param {module:webgl-utils.GetWebGLContextOptions} [opt_options] options
* @memberOf module:webgl-utils
*/
- let setupLesson = function(canva... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/shared-cubes.js | @@ -0,0 +1,91 @@
+'use strict';
+
+/* global THREE */
+
+const state = {
+ width: 300, // canvas default
+ height: 150, // canvas default
+};
+
+function init(data) { /* eslint-disable-line no-unused-vars */
+ const {canvas} = data;
+ const renderer = new THREE.WebGLRenderer({canvas});
+
+ state.width = canvas... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/shared-orbitcontrols.js | @@ -0,0 +1,151 @@
+'use strict';
+
+/* global THREE */
+
+function init(data) { /* eslint-disable-line no-unused-vars */
+ const {canvas, inputElement} = data;
+ const renderer = new THREE.WebGLRenderer({canvas});
+
+ const fov = 75;
+ const aspect = 2; // the canvas default
+ const near = 0.1;
+ const far = 10... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/shared-picking.js | @@ -0,0 +1,125 @@
+'use strict';
+
+/* global THREE */
+
+const state = {
+ width: 300, // canvas default
+ height: 150, // canvas default
+};
+
+const pickPosition = {x: 0, y: 0};
+
+function init(data) { // eslint-disable-line no-unused-vars
+ const {canvas} = data;
+ const renderer = new THREE.WebGLRenderer(... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/threejs-offscreencanvas-w-fallback.html | @@ -0,0 +1,73 @@
+<!-- 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 - OffscreenCanvas w/Fallback</title>
+ <style>
+ ... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/threejs-offscreencanvas-w-orbitcontrols.html | @@ -0,0 +1,185 @@
+<!-- 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 - Offscreen Canvas</title>
+ <style>
+ body {
+ ... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/threejs-offscreencanvas-w-picking.html | @@ -0,0 +1,117 @@
+<!-- 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 - OffscreenCanvas Picking</title>
+ <style>
+ bo... | true |
Other | mrdoob | three.js | 5032300239fca07d213a48e44a1670ba9112e3a4.json | add offscreencanvas article | threejs/threejs-offscreencanvas.html | @@ -0,0 +1,63 @@
+<!-- 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 - OffscreenCanvas</title>
+ <style>
+ body {
+ ... | true |
Other | mrdoob | three.js | 2f7df6f53ad09bc57900f2e71750eb216a6f9163.json | handle workers in editor and use shared editor | threejs/resources/editor-settings.js | @@ -0,0 +1,88 @@
+
+(function() { // eslint-disable-line strict
+'use strict'; // eslint-disable-line strict
+
+function dirname(path) {
+ const ndx = path.lastIndexOf('/');
+ return path.substring(0, ndx + 1);
+}
+
+function getPrefix(url) {
+ const u = new URL(url, window.location.href);
+ const prefix = u.orig... | true |
Other | mrdoob | three.js | 2f7df6f53ad09bc57900f2e71750eb216a6f9163.json | handle workers in editor and use shared editor | threejs/resources/editor.html | @@ -44,15 +44,39 @@
.panes>div {
display: none;
flex: 1 1 50%;
- position: relative;
- overflow: hidden;
+ flex-direction: column;
+ min-width: 0;
/*
this calc is to get things to work in safari.
- but firefox and chrome will let chidren of
- the panes go 100% size but not safarai... | true |
Other | mrdoob | three.js | 2f7df6f53ad09bc57900f2e71750eb216a6f9163.json | handle workers in editor and use shared editor | threejs/resources/editor.js | @@ -1,9 +1,17 @@
-(function() { // eslint-disable-line
-'use strict'; // eslint-disable-line
+(function() { // eslint-disable-line strict
+'use strict'; // eslint-disable-line strict
-/* global monaco, require */
+/* global monaco, require, lessonEditorSettings */
-const lessonHelperScriptRE = /<script src="[^"... | true |
Other | mrdoob | three.js | 2f7df6f53ad09bc57900f2e71750eb216a6f9163.json | handle workers in editor and use shared editor | threejs/resources/lesson-helper.css | @@ -0,0 +1,19 @@
+.contextlost {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100vw;
+ height: 100vh;
+ background: red;
+ color: white;
+ font-family: monospace;
+ font-weight: bold;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.contextlost>div {
+ padding: 0.5em;
+ bac... | true |
Other | mrdoob | three.js | 2f7df6f53ad09bc57900f2e71750eb216a6f9163.json | handle workers in editor and use shared editor | threejs/resources/lessons-helper.js | @@ -39,11 +39,12 @@
});
} else {
// Browser globals
- root.threejsLessonsHelper = factory.call(root);
+ root.lessonsHelper = factory.call(root);
}
}(this, function() {
'use strict'; // eslint-disable-line
+ const lessonSettings = window.lessonSettings || {};
const topWindow = this;
... | true |
Other | mrdoob | three.js | 2f7df6f53ad09bc57900f2e71750eb216a6f9163.json | handle workers in editor and use shared editor | threejs/resources/lessons-worker-helper.js | @@ -0,0 +1,699 @@
+/*
+ * Copyright 2019, Gregg Tavares.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ ... | true |
Other | mrdoob | three.js | 929c4ec8cd7c6744926a827a03d09f38b402965f.json | add suggestion link | threejs/lessons/langinfo.hanson | @@ -5,7 +5,7 @@
title: 'three.js fundamentals',
description: 'Learn Three.js',
link: 'http://threejsfundamentals.org/',
- commentSectionHeader: '<div>Questions? <a href="http://stackoverflow.com/questions/tagged/three.js">Ask on stackoverflow</a>.</div>\n <div>Issue/Bug? <a href="http://github.com/greg... | false |
Other | mrdoob | three.js | 849d8a8676fc251fa26d1ffce419df388e1cedc3.json | add webvr point to select article | threejs/lessons/threejs-webvr-point-to-select.md | @@ -0,0 +1,382 @@
+Title: Three.js WebVR - 3DOF Point to Select
+Description: How to implement 3DOF Point to Select.
+
+**NOTE: The examples on this page require a VR capable
+device with a pointing device. Without one they won't work. See [this article](threejs-webvr.html)
+as to why**
+
+In the [previous article](thr... | true |
Other | mrdoob | three.js | 849d8a8676fc251fa26d1ffce419df388e1cedc3.json | add webvr point to select article | threejs/lessons/toc.html | @@ -25,6 +25,7 @@
<ul>
<li><a href="/threejs/lessons/threejs-webvr.html">WebVR - Basics</a></li>
<li><a href="/threejs/lessons/threejs-webvr-look-to-select.html">WebVR - Look To Select</a></li>
+ <li><a href="/threejs/lessons/threejs-webvr-point-to-select.html">WebVR - Point To Select</a></li>
</ul>
... | true |
Other | mrdoob | three.js | 849d8a8676fc251fa26d1ffce419df388e1cedc3.json | add webvr point to select article | threejs/threejs-webvr-point-to-select-w-move.html | @@ -0,0 +1,247 @@
+<!-- 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 - WebVR - Point to Select w/Move</title>
+ <style>
... | true |
Other | mrdoob | three.js | 849d8a8676fc251fa26d1ffce419df388e1cedc3.json | add webvr point to select article | threejs/threejs-webvr-point-to-select.html | @@ -0,0 +1,218 @@
+<!-- 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 - WebVR - Point to Select</title>
+ <style>
+ bo... | true |
Other | mrdoob | three.js | 3d96d13d8e752774239a9ecc573069b4ae93ca57.json | switch meshes instead of changing background | threejs/lessons/threejs-webvr-look-to-select.md | @@ -384,82 +384,80 @@ time. If so we add the elapsed time to a timer and if the timer reaches it's
limit we return the selected item.
Now let's use that to pick the cubes. As a simple example
-we'll just change the background texture to match the
-selected cube.
+we'll add 3 spheres as well. When a cube is picked w... | true |
Other | mrdoob | three.js | 3d96d13d8e752774239a9ecc573069b4ae93ca57.json | switch meshes instead of changing background | threejs/threejs-webvr-look-to-select-w-cursor.html | @@ -39,11 +39,18 @@
const camera = new THREE.PerspectiveCamera(fov, aspect, near, far);
const scene = new THREE.Scene();
- const loader = new THREE.CubeTextureLoader();
- function loadCubemap(url) {
- return loader.load([url, url, url, url, url, url]);
+ {
+ const loader = new THREE.CubeTextureLoader()... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/lessons/threejs-webvr.md | @@ -1,16 +1,68 @@
Title: Three.js WebVR
Description: How to use Virtual Reality in Three.js.
-Making WebVR apps in three.js is pretty simple.
-You basically just have to tell three.js you want to use WebVR.
-If you think about it a few things about WebVR should be clear.
-Which way the camera is pointing is supplie... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/threejs-webvr-basic-vr-optional.html | @@ -121,7 +121,7 @@
function render(time) {
time *= 0.001;
- if (resizeRendererToDisplaySize(renderer)) {
+ if (!renderer.vr.isPresenting() && resizeRendererToDisplaySize(renderer)) {
const canvas = renderer.domElement;
camera.aspect = canvas.clientWidth / canvas.clientHeight;
camer... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/threejs-webvr-basic-w-background.html | @@ -98,7 +98,7 @@
function render(time) {
time *= 0.001;
- if (resizeRendererToDisplaySize(renderer)) {
+ if (!renderer.vr.isPresenting() && resizeRendererToDisplaySize(renderer)) {
const canvas = renderer.domElement;
camera.aspect = canvas.clientWidth / canvas.clientHeight;
camera.... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/threejs-webvr-basic.html | @@ -86,7 +86,7 @@
function render(time) {
time *= 0.001;
- if (resizeRendererToDisplaySize(renderer)) {
+ if (!renderer.vr.isPresenting() && resizeRendererToDisplaySize(renderer)) {
const canvas = renderer.domElement;
camera.aspect = canvas.clientWidth / canvas.clientHeight;
camera.... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/threejs-webvr-look-to-select-selector.html | @@ -103,7 +103,7 @@
function render(time) {
time *= 0.001;
- if (resizeRendererToDisplaySize(renderer)) {
+ if (!renderer.vr.isPresenting() && resizeRendererToDisplaySize(renderer)) {
const canvas = renderer.domElement;
const aspect = canvas.clientWidth / canvas.clientHeight;
camera... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/threejs-webvr-look-to-select-w-cursor.html | @@ -193,7 +193,7 @@
function render(time) {
time *= 0.001;
- if (resizeRendererToDisplaySize(renderer)) {
+ if (!renderer.vr.isPresenting() && resizeRendererToDisplaySize(renderer)) {
const canvas = renderer.domElement;
camera.aspect = canvas.clientWidth / canvas.clientHeight;
camer... | true |
Other | mrdoob | three.js | 394abbb9d1f879eb47f4c565b3d307bab851e610.json | fix resize in VR | threejs/threejs-webvr-look-to-select.html | @@ -128,7 +128,7 @@
function render(time) {
time *= 0.001;
- if (resizeRendererToDisplaySize(renderer)) {
+ if (!renderer.vr.isPresenting() && resizeRendererToDisplaySize(renderer)) {
const canvas = renderer.domElement;
camera.aspect = canvas.clientWidth / canvas.clientHeight;
camer... | true |
Other | mrdoob | three.js | 0270f3d0663d9c2f43870488715091dd7e2f4f93.json | remove unused file | threejs/lessons/threejs-textures-canvas.md | @@ -1,6 +0,0 @@
-Title: Three.js Canvas Textures
-Description: How to use a canvas as a texture.
-
-TBD
-
- | false |
Other | mrdoob | three.js | a9e4075a80db06c37a1d2800e90a6e92089aef94.json | correct a mistake in writing | threejs/lessons/threejs-load-gltf.md | @@ -291,7 +291,7 @@ the new `Object3D` a `cars` array.
+
+ root.updateMatrixWorld();
+ for (const car of loadedCars.children.slice()) {
-+ const fix = fixes.find(fix => car.name.startsWith+(fix.prefix));
++ const fix = fixes.find(fix => car.name.startsWith(fix.prefix));
+ const obj = new THREE.... | false |
Other | mrdoob | three.js | 201d00b9c315ee7be245303f44c1605629ee9a12.json | add disqus formatting comment | threejs/lessons/langinfo.hanson | @@ -5,8 +5,24 @@
title: 'three.js fundamentals',
description: 'Learn Three.js',
link: 'http://threejsfundamentals.org/',
- commentSectionHeader: '<div>Questions? <a href="http://stackoverflow.com/questions/tagged/three.js">Ask on stackoverflow</a>.</div>\n <div><a href="https://github.com/gfxfundamenta... | true |
Other | mrdoob | three.js | 201d00b9c315ee7be245303f44c1605629ee9a12.json | add disqus formatting comment | threejs/lessons/resources/lesson.css | @@ -87,6 +87,12 @@ div[data-diagram] {
border: 1px solid black;
}
+.lesson-comment-notes {
+ padding: 1em;
+ margin: 1em;
+ background: #DDD;
+ color: red;
+}
.threejs_navbar>div,
.lesson-title,
@@ -556,5 +562,8 @@ pre.prettyprint.lighttheme .fun { color: #900; } /* function name */
div.threejs_bottom... | true |
Other | mrdoob | three.js | 28fac0dabd02ce2a498d6cbb367aa126f4ca15ae.json | add contribute banner to all pages | build/templates/header.template | @@ -6,5 +6,6 @@
</div>
<div class="threejs_header">
<h1><a href="{{langInfo.home}}">threejsfundamentals.org</a></h1>
+{{{include "build/templates/repobanner.template"}}}
</div>
| true |
Other | mrdoob | three.js | 28fac0dabd02ce2a498d6cbb367aa126f4ca15ae.json | add contribute banner to all pages | build/templates/index.template | @@ -98,73 +98,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div>
</div>
</div>
+{{{include "build/templates/repobanner.template"}}}
<iframe class="background" src="/threejs/background.html"></iframe>
-<style>
-#forkongithub a {
- background: #000;
- color: #fff;
- text-d... | true |
Other | mrdoob | three.js | 28fac0dabd02ce2a498d6cbb367aa126f4ca15ae.json | add contribute banner to all pages | build/templates/octocat-icon.svg | @@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 136 133" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x... | true |
Other | mrdoob | three.js | 28fac0dabd02ce2a498d6cbb367aa126f4ca15ae.json | add contribute banner to all pages | build/templates/repobanner.template | @@ -0,0 +1,76 @@
+<style>
+#forkongithub a {
+ background: #000;
+ color: #fff;
+ text-decoration: none;
+ font-family: arial,sans-serif;
+ text-align: center;
+ font-weight: bold;
+ padding: 5px 40px;
+ font-size: 0.9rem;
+ line-height: 2rem;
+ position: relative;
+ transition: 0.5s;
+... | true |
Other | mrdoob | three.js | 28fac0dabd02ce2a498d6cbb367aa126f4ca15ae.json | add contribute banner to all pages | threejs/lessons/resources/lesson.css | @@ -123,6 +123,7 @@ div[data-diagram] {
background-position: center, center;
padding: 1em;
text-align: center;
+ position: relative;
}
.threejs_header h1 {
font-size: 5vw; | true |
Other | mrdoob | three.js | eada0c6ef3001e42c25d574f561ad066e8daaf32.json | add info on Points and PointsMaterial | threejs/lessons/resources/threejs-primitives.js | @@ -326,6 +326,41 @@ import {threejsLessonUtils} from './threejs-lesson-utils.js';
},
nonBuffer: false,
},
+ Points: {
+ create() {
+ const radius = 7;
+ const widthSegments = 12;
+ const heightSegments = 8;
+ const geometry = new THREE.SphereBufferGeometry(radius,... | true |
Other | mrdoob | three.js | eada0c6ef3001e42c25d574f561ad066e8daaf32.json | add info on Points and PointsMaterial | threejs/lessons/threejs-primitives.md | @@ -291,6 +291,46 @@ and it's best to [look in the documentation](https://threejs.org/docs/) for all
repeat them here. You can also click the links above next to each shape
to take you directly to the docs for that shape.
+There is one other pair of classes that doesn't really fit the patterns above. Those are
+the... | true |
Other | mrdoob | three.js | eb14a670e7b95fac283bf996f6225aad507a2d61.json | add dev notes | DEVELOPMENT.md | @@ -0,0 +1,24 @@
+# DEVELOPMENT NOTES
+
+## archiving old versions
+
+(hopefully automated someday)
+
+1. make repo on github
+2. in threejsfundamentals.org
+ 1. git fetch origin gh-pages
+ 2. git checkout gh-pages
+ 3. git rebase origin/gh-pages?
+ 4. git clone --branch gh-pages ../old.threejsfundamentals/rXXX... | false |
Other | mrdoob | three.js | 6f09b6546399cb9d39284fba8231aea76b9aecd5.json | add another example using http-server | threejs/lessons/threejs-setup.md | @@ -43,6 +43,11 @@ Once you've done that type
http-server path/to/folder/where/you/unzipped/files
+Or if you're like me
+
+ cd path/to/folder/where/you/unzipped/files
+ http-server
+
It should print something like
{{{image url="resources/http-server-response.png" }}} | false |
Other | mrdoob | three.js | 61f41f468a6efd3c8f086f175ba4776d0c369fc0.json | use module in prerequisites | threejs/lessons/threejs-prerequisites.md | @@ -5,8 +5,9 @@ TOC: Prerequisites
These articles are meant to help you learn how to use three.js.
They assume you know how to program in JavaScript. They assume
you know what the DOM is, how to write HTML as well as create DOM elements
-in JavaScript. They assume you know how to use `<script>` tags to
-include exte... | true |
Other | mrdoob | three.js | 61f41f468a6efd3c8f086f175ba4776d0c369fc0.json | use module in prerequisites | threejs/lessons/zh_cn/threejs-prerequisites.md | @@ -46,20 +46,6 @@ DOM元素。假设你知道如何使用 `<script>`标签来
or [use the `defer` property](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script).
-## 不需要`type="text/javascript"`
-
-最新的
-
- <script>...</script>
-
-过时的
-
- <script type="text/javascript"></script>
-
-## 始终使用`strict`模式
-
-将`'use strict';`放在JavaS... | true |
Other | mrdoob | three.js | 81e6567ce7de82e01b0583452602b9cf6a223fe4.json | use module in fundamentals | threejs/lessons/ru/threejs-fundamentals.md | @@ -41,10 +41,8 @@ Three.js будет рисовать на этом холсте, так что
его и передать three.js.
```
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | 81e6567ce7de82e01b0583452602b9cf6a223fe4.json | use module in fundamentals | threejs/lessons/threejs-fundamentals.md | @@ -40,10 +40,8 @@ Three.js will draw into that canvas so we need to look it up
and pass it to three.js.
```html
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelec... | true |
Other | mrdoob | three.js | 81e6567ce7de82e01b0583452602b9cf6a223fe4.json | use module in fundamentals | threejs/lessons/zh_cn/threejs-fundamentals.md | @@ -34,10 +34,8 @@ Three.js经常会和WebGL混淆,
Three.js将会使用这个canvas标签所以我们要先获取它然后传给three.js。
```html
-<script>
-'use strict';
-
-/* global THREE */
+<script type="module">
+import * as THREE from './resources/threejs/r108/build/three.module.js';
function main() {
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/lessons/threejs-offscreencanvas.md | @@ -10,6 +10,10 @@ to a web worker so as not to slow down the responsiveness of the browser. It
also means data is loaded and parsed in the worker so possibly less jank while
the page loads.
+One big issue with offscreen canvas is, at least in Chrome, es6 modules are not yet
+supported on web workers, so, unlike al... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/offscreencanvas-cubes.js | @@ -1,8 +1,8 @@
-'use strict';
+'use strict'; // eslint-disable-line
/* global importScripts, THREE */
-importScripts('resources/threejs/r108/three.min.js');
+importScripts('resources/threejs/r108/build/three.min.js');
const state = {
width: 300, // canvas default | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/offscreencanvas-worker-cubes.js | @@ -2,7 +2,7 @@
/* global importScripts, init, state */
-importScripts('resources/threejs/r108/three.min.js');
+importScripts('resources/threejs/r108/build/three.min.js');
importScripts('shared-cubes.js');
function size(data) { | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/offscreencanvas-worker-orbitcontrols.js | @@ -2,8 +2,8 @@
/* global importScripts, init, THREE */
-importScripts('resources/threejs/r108/three.js');
-importScripts('resources/threejs/r108/js/controls/OrbitControls.js');
+importScripts('resources/threejs/r108/build/three.min.js');
+importScripts('resources/threejs/r108/examples/js/controls/OrbitControls.js... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/offscreencanvas-worker-picking.js | @@ -2,7 +2,7 @@
/* global importScripts, init, state, pickPosition */
-importScripts('resources/threejs/r108/three.min.js');
+importScripts('resources/threejs/r108/build/three.min.js');
importScripts('shared-picking.js');
function size(data) { | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/shared-cubes.js | @@ -1,6 +1,4 @@
-import * as THREE from 'resources/threejs/r108/build/three.module.js';
-
-export const state = {
+const state = {
width: 300, // canvas default
height: 150, // canvas default
}; | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/shared-orbitcontrols.js | @@ -1,7 +1,4 @@
-import * as THREE from './resources/threejs/r108/build/three.module.js';
-import {OrbitControls} from './resources/threejs/r108/examples/jsm/controls/OrbitControls.js';
-
-export function init(data) { /* eslint-disable-line no-unused-vars */
+function init(data) { /* eslint-disable-line no-unused-v... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/shared-picking.js | @@ -1,13 +1,11 @@
-import * as THREE from './resources/threejs/r108/build/three.module.js';
-
-export const state = {
+const state = {
width: 300, // canvas default
height: 150, // canvas default
};
-export const pickPosition = {x: 0, y: 0};
+const pickPosition = {x: 0, y: 0};
-export function init(data) ... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/threejs-offscreencanvas-w-fallback.html | @@ -19,8 +19,12 @@
<body>
<canvas id="c"></canvas>
</body>
-<script type="module">
-import {state, init} from './shared-cubes.js';
+<script src="resources/threejs/r108/build/three.min.js"></script>
+<script src="shared-cubes.js"></script>
+<script>
+'use strict'; // eslint-disable-line
+
+/* globals state, ... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/threejs-offscreencanvas-w-orbitcontrols.html | @@ -22,8 +22,13 @@
<body>
<canvas id="c" tabindex="1"></canvas>
</body>
-<script type="module">
-import {init} from './shared-orbitcontrols.js';
+<script src="resources/threejs/r108/build/three.min.js"></script>
+<script src="resources/threejs/r108/examples/js/controls/OrbitControls.js"></script>
+<script sr... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/threejs-offscreencanvas-w-picking.html | @@ -19,8 +19,13 @@
<body>
<canvas id="c"></canvas>
</body>
-<script type="module">
-import {state, init, pickPosition} from './shared-picking.js';
+<script src="resources/threejs/r108/build/three.min.js"></script>
+<script src="resources/threejs/r108/examples/js/controls/OrbitControls.js"></script>
+<script ... | true |
Other | mrdoob | three.js | 054f6ec64440bbed8017b98f2bdfba1df4dc8ea7.json | put offscreen back to non es6 module | threejs/threejs-offscreencanvas.html | @@ -31,7 +31,8 @@
<div>no OffscreenCanvas support</div>
</div>
</body>
-<script type="module">
+<script>
+'use strict'; // eslint-disable-line
function main() { /* eslint consistent-return: 0 */
const canvas = document.querySelector('#c'); | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | .github/ISSUE_TEMPLATE/bug-issue-report.md | @@ -7,4 +7,3 @@ assignees: ''
---
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | .github/ISSUE_TEMPLATE/question.md | @@ -7,4 +7,3 @@ assignees: ''
---
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | .github/ISSUE_TEMPLATE/request.md | @@ -7,4 +7,3 @@ assignees: ''
---
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | .github/ISSUE_TEMPLATE/suggest-topic.md | @@ -7,4 +7,3 @@ assignees: ''
---
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | .github/ISSUE_TEMPLATE/translation.md | @@ -7,4 +7,3 @@ assignees: ''
---
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | contributors.md | @@ -5,4 +5,3 @@ Threejsfundamentals is brought to you by:
* Gregg (Greggman) Tavares [games.greggman.com](http://games.greggman.com)
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/3dlut-base-cube-maker.html | @@ -26,7 +26,6 @@ <h1>Color Cube Image Maker</h1>
</body>
<script type="module">
-
const ctx = document.querySelector('canvas').getContext('2d');
function drawColorCubeImage(ctx, size) { | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/canvas-random-dots.html | @@ -10,7 +10,6 @@
</body>
<script type="module">
-
function main() {
const ctx = document.createElement('canvas').getContext('2d');
document.body.appendChild(ctx.canvas); | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/gpw-data-viewer.html | @@ -14,7 +14,6 @@
</body>
<script type="module">
-
async function loadFile(url) {
const req = await fetch(url);
return req.text(); | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/index.md | @@ -4,12 +4,10 @@ A set of articles to help learn Three.js.
{{{include "threejs/lessons/toc.html"}}}
-
<!--
{{{table_of_contents}}}
-->
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/ru/index.md | @@ -4,12 +4,10 @@ Title: Основы Three.js
{{{include "threejs/lessons/ru/toc.html"}}}
-
<!--
{{{table_of_contents}}}
-->
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/ru/threejs-materials.md | @@ -320,4 +320,3 @@ flat shaded
<canvas id="c"></canvas>
<script type="module" src="../resources/threejs-materials.js"></script>
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/ru/threejs-primitives.md | @@ -247,7 +247,6 @@ function addSolidGeometry(x, y, geometry) {
Если бы мы этого не делали, текст был бы оторван от центра.
-
{{{example url="../threejs-primitives-text.html" }}}
Обратите внимание, что то что слева не вращается вокруг своего центра, | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-custom-buffergeometry.md | @@ -463,4 +463,3 @@ depends on your needs.
<canvas id="c"></canvas>
<script type="module" src="resources/threejs-custom-buffergeometry.js"></script>
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-debugging-glsl.md | @@ -110,4 +110,3 @@ live while the code is running.
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-materials.md | @@ -306,4 +306,3 @@ switch from using one to using the other.
<canvas id="c"></canvas>
<script type="module" src="resources/threejs-materials.js"></script>
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-optimize-lots-of-objects-animated.md | @@ -266,7 +266,6 @@ First let's change `addBoxes` to just make and return the merged geometry.
...
-
- const mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(
- geometries, false);
- const material = new THREE.MeshBasicMaterial({
@@ -725,4 +724,3 @@ not make a good visualization. Feel free ... | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-primitives.md | @@ -352,4 +352,3 @@ to use it](threejs-scenegraph.html).
<link rel="stylesheet" href="resources/threejs-primitives.css">
<script type="module" src="resources/threejs-primitives.js"></script>
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-shadows.md | @@ -129,7 +129,6 @@ The shadow is a `MeshBasicMaterial` because it doesn't need lighting.
We make each sphere a different hue and then save off the base, the sphere mesh,
the shadow mesh and the initial y position of each sphere.
-
```js
const numSpheres = 15;
for (let i = 0; i < numSpheres; ++i) {
@@ -434,7 +43... | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/threejs-voxel-geometry.md | @@ -1068,7 +1068,6 @@ in the adjacent cell might need new geometry. This means
we need to check the cell for the voxel we just edited
as well as in all 6 directions from that cell.
-
```js
const neighborOffsets = [
[ 0, 0, 0], // self
@@ -1215,4 +1214,3 @@ to generate some what efficient geometry.
<canvas i... | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/tools/geo-picking/README.md | @@ -24,4 +24,3 @@ export the table called `level1` to a json file called `level1.json`
Then run a simple server like above and open `make-geo-picking-texture-ogc.html` in your browser.
- | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/tools/geo-picking/make-geo-picking-texture-ogc.html | @@ -9,7 +9,6 @@
// # need to draw to 2nd canvas, then shave off non perfect pixels
-
async function main() {
const ctx = document.querySelector('canvas').getContext('2d');
ctx.canvas.width = 2048; | true |
Other | mrdoob | three.js | 0c4969b330f0e84636d4f535a2e90dc80249a68e.json | remove extra lines | threejs/lessons/zh_cn/index.md | @@ -4,12 +4,10 @@ Title: Three.js基础
{{{include "threejs/lessons/toc.html"}}}
-
<!--
{{{table_of_contents}}}
-->
- | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.