Home

Awesome

three-full

License

Deprecation note:

I am glad to annonce since Three release his examples files under JSM folder, this repository should be avoided. The first goal of this repository was to provided an alternative solution during this migration. From now, please consider to use Three.module.js instead even if i maintain this repository for my personal usage. Thanks for all ! Itee...

The version 28.0.2 is now available under Three r0.113.2

Extended Three JavaScript 3D library

Three.js come with lot of examples files, which are curently not usable as ES6 module. The purpose of this project is to convert all examples files and includes them as part of the library.

Setup

Assuming that npm and node are already installed.

Install:

npm install --save three-full

Usage

Like Three.js but with more, more and more available stuff.

Using ES6:
import { WhatIWant } from 'node_modules/three-full/builds/Three.es.js'
// equivalent to
import { WhatIWant } from 'three-full'
 
// or directly from sources folder
 
import { Ocean } from 'node_modules/three-full/sources/Ocean'
Using Node/CommonJS:
const Three = require('node_modules/three-full/builds/Three.cjs.js')
// equivalent to 
const Three = require('three-full')
Using UMD:
const Three = require('node_modules/three-full/builds/Three.umd.js')
Using AMD:
require(['node_modules/three-full/builds/Three.amd.js'], 
    function( Three ){
    
        //...
        
});
From HTML (not recommended):
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Three Full Es6</title>
    </head>
    <body>
        <script src="node_modules/three-full/builds/Three.iife.js"></script>
        <script>
            alert('Three.REVISION: ' + Three.REVISION)
        </script>
    </body>
</html>

Note: You should copy the file in right server location to serve it correctly, and use Three.iife.min.js under production ! Importing the all library in HTML page should be avoided, use a proper module bundler like webpack or rollup using es6 module syntaxe !

Commands

In case you want participate, you need to known some commands below:

Help:

npm run help

Will display all you need to known about available commands in three-full package

Patch:

npm run patch

<span style="color:red">Important: After installing/reinstalling node_modules/three you need to apply patch only once, for fix some examples parts.</span>

Convert:

npm run convert

This command will convert all examples files as ES6 modules (*) and copy all three files at top level of the package in view to be build.

Build:<br>

npm run build

This command will build converted sources as UMD, AMD, ES (*), CJS and IIFE using Rollup

<a id="miss"></a>Missings Files

This is the list of unsupported part of example, which cannot/won't be converted.

<a id="miss"></a>Missings Imports

<a id="redirectedFiles"></a>Redirected Files

All JSM files are mapped to their counter-part under sources folders except

FilenameNew Location
ConvexObjectBreaker'modifiers/ConvexObjectBreaker.js'
Curve'curves/Curve.js'
Earcut'misc/Earcut.js'
GPUComputationRenderer'renderers/GPUComputationRenderer.js'
Gyroscope'objects/Gyroscope.js'
ImageUtils'utils/ImageUtils.js'
MD2Character'objects/MD2Character.js'
MD2CharacterComplex'objects/MD2CharacterComplex.js'
MorphAnimMesh'objects/MorphAnimMesh.js'
MorphBlendMesh'objects/MorphBlendMesh.js'
Ocean'objects/Ocean.js'
PMREMGenerator'utils/PMREMGenerator.js'
RollerCoaster'objects/RollerCoaster.js'
ShapeUtils'utils/ShapeUtils.js'
VolumeSlice'audio/VolumeSlice.js'
WebGL'helpers/WebGL.js'

Change log

28.0.2:
28.0.1:
28.0.0:
27.0.0:
26.0.0:
25.0.0:
24.0.0:
23.0.1:
23.0.0:
22.0.0:
21.0.0:
20.0.0:
19.0.0:
18.0.0:
17.2.0:
17.1.0:
17.0.0:
16.0.1:
16.0.0:
15.0.0:
14.0.0:
13.0.0:
12.0.0:
11.3.3:
11.3.2:
11.3.1:
11.3.0:
11.2.0:
11.1.1:
11.1.0:
11.0.0:
10.0.0:
9.0.0:
8.0.0:
7.0.0:
6.0.0:
5.0.7:
5.0.6:
5.0.5:
5.0.4:
5.0.3:
5.0.2 (Thanks to Marc Bartels):
5.0.1 :
5.0.0 :
4.2.4 :
4.2.3 :
4.2.2 :
4.2.1 :
4.2.0 :
4.1.1 :
4.1.0 :
4.0.0 :
3.0.0 :
2.2.0 :
2.1.1 :
2.1.0 :
2.0.0 :