The version 8.0.0 is now available under Three r0.93.0 !!!
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.
Assuming that npm and node are already installed.
Install:
npm install --save three-full
Like Three.js but with more, more and more available stuff.
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'
const Three = require('node_modules/three-full/builds/Three.cjs.js')
const Three = require('node_modules/three-full/builds/Three.umd.js')
require(['node_modules/three-full/builds/Three.amd.js'],
function( Three ){
//...
});
<!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 !
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
Important: After installing/reinstalling node_modules/three you need to apply patch only once, for fix some examples parts.
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:
npm run build
This command will build converted sources as UMD, AMD, ES (*), CJS and IIFE using Rollup
This is the list of unsupported part of example, which cannot/won't be converted.
-
Intermediary exporter files
- Curves.js
- Geometries.js
- Materials.js
-
Workers
- RaytracingWorker.js
- OffscreenCanvas.js
- ctm folder
-
Folders
- draco //draco_decoder use Eval !
- sea3d //Duplicate export 'SEA3D', namespace not managed yet
- crossfade folder //Scene has already been declared
-
Specific Files
- Cloth.js //Use global variable from html example file !
- ParametricGeometries.js //Wrong export of TorusKnotCurve
- OceanShaders.js //Need to check how to extends imported lib properly
- RectAreaLightUniformsLib.js //Need to check how to extends imported lib properly
- Volume.js //Use Eval !
- NRRDLoader.js //Import Volume.js
- XLoader.js //Unprocessable AMD module style
- AnimationClipCreator ---> 'animation/AnimationClipCreator.js'
- ArcCurve ---> 'curves/ArcCurve.js'
- BufferGeometryUtils ---> 'utils/BufferGeometryUtils.js'
- Car ---> 'objects/Car.js'
- CatmullRomCurve3 ---> 'curves/CatmullRomCurve3.js'
- ConvexObjectBreaker ---> 'modifiers/ConvexObjectBreaker.js'
- CubicBezierCurve ---> 'curves/CubicBezierCurve.js'
- CubicBezierCurve3 ---> 'curves/CubicBezierCurve3.js'
- Curve ---> 'curves/Curve.js'
- CurveExtras ---> 'curves/CurveExtras.js'
- CurvePath ---> 'core/CurvePath.js'
- Detector ---> 'helpers/Detector.js'
- Earcut ---> 'misc/Earcut.js'
- EllipseCurve ---> 'curves/EllipseCurve.js'
- Font ---> 'core/Font.js'
- GPUComputationRenderer ---> 'renderers/GPUComputationRenderer.js'
- GPUParticleSystem ---> 'objects/GPUParticleSystem.js'
- Gyroscope ---> 'objects/Gyroscope.js'
- ImmediateRenderObject ---> 'objects/ImmediateRenderObject.js'
- ImprovedNoise ---> 'misc/ImprovedNoise.js'
- Interpolation ---> 'core/Interpolation.js'
- LineCurve ---> 'curves/LineCurve.js'
- LineCurve3 ---> 'curves/LineCurve3.js'
- MarchingCubes ---> 'objects/MarchingCubes.js'
- MD2Character ---> 'objects/MD2Character.js'
- MD2CharacterComplex ---> 'objects/MD2CharacterComplex.js'
- MorphAnimMesh ---> 'objects/MorphAnimMesh.js'
- MorphBlendMesh ---> 'objects/MorphBlendMesh.js'
- Ocean ---> 'objects/Ocean.js'
- Octree ---> 'utils/Octree.js'
- Path ---> 'core/Path.js'
- PRNG ---> 'utils/PRNG.js'
- QuadraticBezierCurve ---> 'curves/QuadraticBezierCurve.js'
- QuadraticBezierCurve3 ---> 'curves/QuadraticBezierCurve3.js'
- QuickHull ---> 'utils/QuickHull.js'
- RollerCoaster ---> 'objects/RollerCoaster.js'
- ShaderGodRays ---> 'shaders/ShaderGodRays.js'
- ShaderSkin ---> 'shaders/ShaderSkin.js'
- ShaderTerrain ---> 'shaders/ShaderTerrain.js'
- ShaderToon ---> 'shaders/ShaderToon.js'
- Shape ---> 'core/Shape.js'
- ShapePath ---> 'core/ShapePath.js'
- ShapeUtils ---> 'utils/ShapeUtils.js'
- SimplexNoise ---> 'misc/SimplexNoise.js'
- SplineCurve ---> 'curves/SplineCurve.js'
- TimelinerController ---> 'animation/TimelinerController.js'
- TypedArrayUtils ---> 'utils/TypedArrayUtils.js'
- UCSCharacter ---> 'objects/UCSCharacter.js'
- VolumeSlice ---> 'audio/VolumeSlice.js'
All others folders under example file tree will be mapped to their counter-part under sources folders
- No known bug
- Support of Three r93
- Support of Three r92
- Support of Three r91
- Fix DefaultLoadingManager import in OBJLoader2
- Fix ShaderLib, UniformsLib, and UniformsUtils imports in LineMaterial
- Fix DefaultLoadingManager, Uint16BufferAttribute and Uint32BufferAttribute imports in DRACOLoader
- Remove fix-camera-node task due to threejs fix
- Fix missings PropertyBinding imports in FBXLoader
- Fix missings PropertyBinding imports in GLTFExporter
- Fix missings AnimationClip imports in MorphAnimMesh
- Fix missings AnimationClip imports in MD2Loader
- Fix missings _Math imports in SoftwareRenderer
- Fix missings CameraNode imports in NodeMaterialLoader
- Fix missings Interpolant imports in MMDLoader
- Remove unnecessary _Math imports
- Add a window global variable check to avoid crach under nodejs
- Change default entry for main and module in package
- Fix #18, OBJLoader2 worker code
- Fix missings Geometries imports in ObjectLoader
- Fix missings Materials imports in LoaderMaterial
- Fix missings Curves imports in CurvePath
- Fix missings Loader imports in GLTFLoader
- Fix invalid module.export stuff inside Detector
- Reintroduce LineSegment fix
- Support of Three r90
- Move the example folder tree to source /!\ In case you're using direct source import, please check the '(Redirected Files)' part
- Fix Math (instead of _Math) issue
- Fix missings imports/exports
- Reintroduce RollerCoaster stuff
- Fix Line/LineSegments circular dependency ( Be aware: Line constructor don't return LineSegments in case of wrong arguments, and log an error instead of a warning )
- Fix Detector module.export code snippet
- README.md fix wrong copy/paste
- Ignore some dev files for npm
- Change main entry point of package to Three.es.js
- Fix NodeLib circular dependency with FunctionNode
- Allow to build es module under production environment
- Fix node warning about unhandled promise rejection
- Fix rollup warning about indent option moved under output options
- Clean up sources
- XLoader.js: is now ignored due to AMD module
- Add Earcut, Curves, EXRLoader, GCodeLoader, LoaderUtils
- Remove KeyframeTrackConstructor, KeyframeTrackPrototype, PathPrototype and ImageUtils
- Update imports statements
- Cloth.js: is remove due to bad usage of global variable from his html example file
- Add two new fix for three package in CameraNode and NodeLib
- Fix almost all missings imports statements
- Note:
- MMDExporter and MMDLoader need external dependency from https://github.com/takahirox/mmd-parser
- FBXLoader and VTKLoader need external dependency from https://github.com/imaya/zlib.js
- TTFLoader need external dependency from https://github.com/nodebox/opentype.js
- Add tests about every file to check their imports
- Fix missing import statement in ShaderPass
- Export and import statement support multilines
- Support Three.js r88
- Reintroduce ColladaLoader in available modules
- Refactor the convert pipeline