Skip to content

Commit 73a250b

Browse files
authored
Merge pull request #2 from mrdoob/dev
update
2 parents c6d62fa + 6a05d60 commit 73a250b

File tree

2,245 files changed

+284232
-102864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,245 files changed

+284232
-102864
lines changed

.github/CONTRIBUTING.md

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
1-
2-
# Help
3-
The issues section is for bug reports and feature requests only. If you need help, please use the [forum](http://discourse.threejs.org/) or [stackoverflow](http://stackoverflow.com/questions/tagged/three.js).
4-
5-
# Bugs
6-
#### Before reporting a bug
7-
8-
1. Search issue tracker for similar issues.
9-
2. Try the latest dev branch version of three.js.
10-
3. Refer to the [Migration Guide](https://github.com/mrdoob/three.js/wiki/Migration) when upgrading to the dev version.
11-
12-
#### How to report a bug
13-
14-
1. Specify the revision number of the three.js library where the bug occurred.
15-
2. Specify your browser version, operating system, and graphics card. (for example, Chrome 23.0.1271.95, Windows 7, Nvidia Quadro 2000M)
16-
3. Describe the problem in detail. Explain what happened, and what you expected would happen.
17-
4. Provide a small test-case (http://jsfiddle.net). [Here is a fiddle](https://jsfiddle.net/3foLr7sn/) you can edit that runs the current version. [And here is a fiddle](https://jsfiddle.net/qgu17w5o/) that uses the dev branch. If a test-case is not possible, provide a link to a live version of your application.
18-
5. If helpful, include a screenshot. Annotate the screenshot for clarity.
19-
201
# Contribution
21-
#### Introduction
2+
## Introduction
223

23-
It is assumed that you know a little about node.js and git. If not, [here's some help to get started
24-
with git](https://help.github.com/en/github/using-git) and [here’s some help to get started with node.js.](https://nodejs.org/en/docs/guides/getting-started-guide/)
4+
It is assumed that you know a little about node.js and git. If not, [here's some help to get started with git](https://help.github.com/en/github/using-git) and [here’s some help to get started with node.js.](https://nodejs.org/en/docs/guides/getting-started-guide/)
255

266
* Install [Node.js](https://nodejs.org/)
277
* Install [Git](https://git-scm.com/)
@@ -30,65 +10,73 @@ with git](https://help.github.com/en/github/using-git) and [here’s some help t
3010
* Change into the directory you’d like
3111
* Clone your forked repo
3212

33-
git clone https://github.com/[yourgithubname]/three.js.git
13+
git clone https://github.com/[yourgithubname]/three.js.git
14+
3415
* Go into the three.js directory.
3516

36-
cd ./three.js
17+
cd ./three.js
18+
3719
* Install the dependencies
3820

39-
npm install
21+
npm install
4022

41-
#### Next Steps
23+
## Next Steps
4224

4325
As per the npm standard, ‘start’ is the place to begin the package.
4426

4527
npm start
4628

47-
This script will start a local server similar to three.js, but instead will be hosted on your local
48-
machine. Browse to http://localhost:8080/ to check it out. It also automatically creates the
49-
‘build/three.js’ and ‘build/three.module.js’ scripts anytime there is a change within your three.js
50-
directory.
29+
This script will start a local server similar to [threejs.org](https://threejs.org/), but instead will be hosted on your local machine. Browse to http://localhost:8080/ to check it out. It also automatically creates the ‘build/three.js’ and ‘build/three.module.js’ scripts anytime there is a change within your three.js directory.
5130

52-
The next most important script runs all the appropriate testing.
53-
54-
npm test
31+
The next most important script runs all the appropriate testing. The E-2-E testing is intended to be run by github actions.
5532

56-
The linting is there to keep a consistent code-style across the all of the code and the testing is
57-
there to help catch bugs and check that the code behaves as expected. It is important that
58-
neither of these steps comes up with any errors due to your changes.
33+
npm test
34+
35+
The linting is there to keep a consistent code-style across the all of the code and the testing is there to help catch bugs and check that the code behaves as expected. It is important that neither of these steps comes up with any errors due to your changes.
36+
37+
Many linting errors can be fixed automatically by running
38+
39+
npm lint-fix
5940

6041
If you’d like to make a minified version of the build files i.e. ‘build/three.min.js’ run:
6142

62-
npm run-script build-closure
43+
npm run build
6344

64-
#### Making changes
45+
## Making changes
6546

6647
When you’ve decided to make changes, start with the following:
48+
6749
* Update your local repo
6850

69-
git pull https://github.com/mrdoob/three.js.git
70-
git push
51+
git pull https://github.com/mrdoob/three.js.git
52+
git push
53+
7154
* Make a new branch from the dev branch
7255

73-
git checkout dev
74-
git branch [mychangesbranch]
75-
git checkout [mychangesbranch]
56+
git checkout dev
57+
git branch [mychangesbranch]
58+
git checkout [mychangesbranch]
59+
7660
* Add your changes to your commit.
7761
* Push the changes to your forked repo.
7862
* Open a Pull Request (PR)
7963

80-
Important notes:
64+
## Important notes:
65+
8166
* Don't include any build files to your commit.
8267
* Not all new features will need a new example. Simpler features could be incorporated into an existing example. Bigger features may be asked to add an example demonstrating the feature.
8368
* Making changes may require changes to the documentation. If so, please make a new PR for the appropriate doc changes. To update the Chinese docs, simply copy the English to begin with.
8469
* it's good to also add an example and screenshot for it, for showing how it's used and for end-to-end testing.
8570
* If you modify existing code, run relevant examples to check they didn't break and there wasn't performance regress.
8671
* If you add some assets for the examples (models, textures, sounds, etc), make sure they have a proper license allowing for their use here, less restrictive the better. It is unlikely for large assets to be accepted.
8772
* If some issue is relevant to patch / feature, please mention it with hash (e.g. #2774) in a commit message to get cross-reference in GitHub.
88-
* If you modify files in examples/js directory, then don't perform any changes in the examples/jsm, JavaScript modules are auto-generated via running ‘node utils/modularize.js’.
89-
* If end-to-end test failed in Travis and you are sure that all is correct, make a new screenshots with npm run make-screenshot <example_1_name> ... <example_N_name> .
90-
* Watch out for Closure compiler warnings when building the libs, there should not be any.
73+
* If you modify files in `examples/js` directory, then don't perform any changes in the `examples/jsm`, JavaScript modules are auto-generated via running `node utils/modularize.js`.
74+
* If end-to-end test failed in Travis and you are sure that all is correct, make a new screenshots with
75+
76+
npm run make-screenshot <example_1_name> ...<example_N_name>
77+
9178
* Once done with a patch / feature do not add more commits to a feature branch
9279
* Create separate branches per patch or feature.
80+
* If you make a PR but it is not actually ready to be pulled into the dev branch, add `[Draft]` into the PR title and/or convert it to a draft PR
9381

94-
This project is currently contributed to mostly via everyone's spare time. Please keep that in mind as it may take some time for the appropriate feedback to get to you. If you are unsure about adding a new feature, it might be better to ask first to see whether other people think it's a good idea.
82+
This project is currently contributed to mostly via everyone's spare time. Please keep that in mind as it may take some time for the appropriate feedback to get to you. If you are unsure about adding a new feature, it might be better to ask first to see whether other people think it's a good idea.

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [mrdoob, HumanInteractive]

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Bug report
3+
about: Report a reproducible bug or regression.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!-- Ignoring this template may result in your bug report getting deleted -->
11+
12+
**Describe the bug**
13+
14+
A clear and concise description of what the bug is. Before submitting, please remove unnecessary sections.
15+
16+
**To Reproduce**
17+
18+
Steps to reproduce the behavior:
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. See error
22+
23+
***Code***
24+
25+
```js
26+
// code goes here
27+
```
28+
29+
***Live example***
30+
31+
* [jsfiddle-latest-release](https://jsfiddle.net/hyok6tvj/)
32+
* [jsfiddle-dev](https://jsfiddle.net/c5m1kazu/)
33+
34+
**Expected behavior**
35+
36+
A clear and concise description of what you expected to happen.
37+
38+
**Screenshots**
39+
40+
If applicable, add screenshots to help explain your problem (drag and drop the image).
41+
42+
**Platform:**
43+
44+
- Device: [Desktop, Mobile]
45+
- OS: [Windows, MacOS, Linux, Android, iOS]
46+
- Browser: [Chrome, Firefox, Safari, Edge]
47+
- Three.js version: [dev, r???]

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Help and Support
4+
url: https://discourse.threejs.org/
5+
about: Please use the forum if you have questions or need help.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for the project.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!-- Ignoring this template may result in your feature request getting deleted -->
11+
12+
**Is your feature request related to a problem? Please describe.**
13+
14+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15+
16+
**Describe the solution you'd like**
17+
18+
A clear and concise description of what you want to happen.
19+
20+
**Describe alternatives you've considered**
21+
22+
A clear and concise description of any alternative solutions or features you've considered.
23+
24+
**Additional context**
25+
26+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Related issue: #XXXX
2+
3+
**Description**
4+
5+
A clear and concise description of what the problem was and how this pull request solves it.
6+
7+
<!-- Remove the line below if is not relevant -->
8+
9+
This contribution is funded by [Example](https://example.com).

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install node
2424
uses: actions/setup-node@v1
2525
with:
26-
node-version: 10
26+
node-version: 12
2727
- name: Install packages
2828
run: npm ci
2929

@@ -39,7 +39,7 @@ jobs:
3939
- name: Install node
4040
uses: actions/setup-node@v1
4141
with:
42-
node-version: 10
42+
node-version: 12
4343
- name: Install packages
4444
run: npm ci && npm ci --prefix test
4545
- name: Build
@@ -63,7 +63,7 @@ jobs:
6363
- name: Install node
6464
uses: actions/setup-node@v1
6565
with:
66-
node-version: 10
66+
node-version: 12
6767
- name: Install packages
6868
run: npm ci && npm ci --prefix test && sudo apt-get install xvfb
6969
- name: Build
@@ -81,7 +81,7 @@ jobs:
8181
- name: Install node
8282
uses: actions/setup-node@v1
8383
with:
84-
node-version: 10
84+
node-version: 12
8585
- name: Install packages
8686
run: npm ci
8787

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ This code creates a scene, a camera, and a geometric cube, and it adds the cube
2727
```javascript
2828
import * as THREE from './js/three.module.js';
2929

30-
var camera, scene, renderer;
31-
var geometry, material, mesh;
30+
let camera, scene, renderer;
31+
let geometry, material, mesh;
3232

3333
init();
34-
animate();
3534

3635
function init() {
3736

@@ -48,23 +47,22 @@ function init() {
4847

4948
renderer = new THREE.WebGLRenderer( { antialias: true } );
5049
renderer.setSize( window.innerWidth, window.innerHeight );
50+
renderer.setAnimationLoop( animation );
5151
document.body.appendChild( renderer.domElement );
5252

5353
}
5454

55-
function animate() {
55+
function animation( time ) {
5656

57-
requestAnimationFrame( animate );
58-
59-
mesh.rotation.x += 0.01;
60-
mesh.rotation.y += 0.02;
57+
mesh.rotation.x = time / 2000;
58+
mesh.rotation.y = time / 1000;
6159

6260
renderer.render( scene, camera );
6361

6462
}
6563
```
6664

67-
If everything went well, you should see [this](https://jsfiddle.net/8kubjpL5/).
65+
If everything went well, you should see [this](https://jsfiddle.net/yf6nks2o/).
6866

6967
### Cloning this repository ###
7068

0 commit comments

Comments
 (0)