Переглянути джерело

Merge pull request #3341 from bghgary/loaders-doc

Update loaders readme to point to usage documentation
David Catuhe 7 роки тому
батько
коміт
72e8a97afe
3 змінених файлів з 6 додано та 274 видалено
  1. 6 18
      loaders/readme.md
  2. 0 74
      loaders/src/OBJ/README.md
  3. 0 182
      loaders/src/glTF/README.md

+ 6 - 18
loaders/readme.md

@@ -1,24 +1,12 @@
 ## Babylon.js loaders
 
-You will find here all loading plugin that you can use to load different formats than .babylon
-
-To use then you just have to reference the loader file:
-
-```
-<script src="Babylon.js"></script>
-<script src="babylon.stlFileLoader.js"></script>
-```
-
-And then the SceneLoader will know how to load the new extension:
-```
-BABYLON.SceneLoader.Load("/Files/", "ch9.stl", engine, function (newScene) { 
-   newScene.activeCamera.attachControl(canvas, false);
-   engine.runRenderLoop(function () { 
-       newScene.render(); 
-   }); 
-});
-```
+### Usage
+See documentation links:
+- https://doc.babylonjs.com/how_to/obj
+- https://doc.babylonjs.com/how_to/stl
+- https://doc.babylonjs.com/how_to/gltf
 
+### Build
 To compile, from the tools/gulp folder:
 
 ```

+ 0 - 74
loaders/src/OBJ/README.md

@@ -1,74 +0,0 @@
-# Babylon.js .obj File Loader
-
-#[Demo](http://www.babylonjs-playground.com/#28YUR5)
-To use it, you just have to reference the loader file:
-
-```
-<script src="babylon.2.1.js"></script>
-<script src="babylon.objFileLoader.js"></script>
-```
-
-Babylon.js will know how to load the obj file and its mtl file automatically: 
-```
-BABYLON.SceneLoader.Load("/assets/", "batman.obj", engine, function (newScene) { 
-   // ...
-});
-```
-```
-var loader = new BABYLON.AssetsManager(scene);
-var batman = loader.addMeshTask("batman", "", "assets/", "batman.obj");
-```
-```
-BABYLON.SceneLoader.ImportMesh("batmanface", "", "batman.obj", scene, function (meshes) { 
-   // ...
-});
-```
-
-## Good things to know
-* Your model doesn't have to be triangulated, as this loader will do it automatically.
-* A Babylon.Mesh will be created for each object/group
-* The obj model should be exported with -Z axis forward, and Y axis upward to be compatible with Babylon.js
-
-![Axis](http://geomorph.sourceforge.net/preview/axes.jpg)
-
-* By default, due to optimization in the code for loading time, UVs problems can appear, like this :
-
-![Batman UVs problem](http://i.imgur.com/vjWKNRK.png)
-
-If you meet this problem, set the variable 
-```
-BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true;
-```
-Then, you'll have a better texture, but with a longer loading.
-
-![Batman UVs ok](http://i.imgur.com/Dajwlvq.png)
-
-## Supported
-* Object/group
-* Faces
-    * triangles
-    * quads
-    * polygons
-* Colors
-    * diffuseColor
-    * ambientColor
-    * specularColor
-    * specularPower
-    * alpha
-* Textures
-    * ambientTexture
-    * diffuseTexture
-    * specularTexture
-    * bumpTexture
-    * opacityTexture
-* Multimaterial
-	* For each material defined in the same mesh, it creates a new BABYLON.Mesh.
-	* The name of the created BABYLON.Mesh follows this syntax: meshName_mmX 
-	* X is the nth BABYLON.Mesh created with this method
-
-    
-## Not supported currently
-* Smoothing groups (s parameter in OBJ file)
-* Illumination (illum parameter in MTL file)
-* The differents options for loading textures in MTL file.
-* A good description about MTL file and his options could be found here: http://paulbourke.net/dataformats/mtl/

+ 0 - 182
loaders/src/glTF/README.md

@@ -1,182 +0,0 @@
-# Babylon.js glTF File Loader
-
-The glTF file loader is a SceneLoader plugin.
-
-[Simple Playground Example](http://www.babylonjs-playground.com/#2IK4U7)
-
-## Setup
-
-**Full Version**
-
-This loader supports both glTF 1.0 and 2.0 and will use the correct loader based on the glTF version string.
-
-```HTML
-<script src="babylon.js"></script>
-<script src="babylon.glTFFileLoader.js"></script>
-```
-
-**Version 1 Only**
-
-This loader supports only glTF 1.0 and will fail to load glTF 2.0.
-
-```HTML
-<script src="babylon.js"></script>
-<script src="babylon.glTF1FileLoader.js"></script>
-```
-
-**Version 2 Only**
-
-This loader supports only glTF 2.0 and will fail to load glTF 1.0.
-
-```HTML
-<script src="babylon.js"></script>
-<script src="babylon.glTF2FileLoader.js"></script>
-```
-
-## Loading the Scene
-The Load function loads a glTF asset into a new scene.
-```JavaScript
-BABYLON.SceneLoader.Load("./", "duck.gltf", engine, function (scene) {
-    // do something with the scene
-});
-```
-
-The Append function appends a glTF file to an existing scene.
-```JavaScript
-BABYLON.SceneLoader.Append("./", "duck.gltf", scene, function (scene) {
-    // do something with the scene
-});
-```
-
-The ImportMesh function imports specific meshes from a glTF asset to an existing scene and returns the imported meshes and skeletons.
-```JavaScript
-// The first parameter can be set to null to load all meshes and skeletons
-BABYLON.SceneLoader.ImportMesh(["myMesh1", "myMesh2"], "./", "duck.gltf", scene, function (meshes, particleSystems, skeletons) {
-    // do something with the meshes and skeletons
-    // particleSystems are always null for glTF assets
-});
-```
-
-## Advanced
-
-The SceneLoader returns the glTF loader instance to enable setting properties per instance.
-
-```JavaScript
-var loader = BABYLON.SceneLoader.Load("./", "duck.gltf", engine, function (scene) {
-    // do something with the scene
-});
-
-// do something with the loader
-// loader.<option1> = <...>
-// loader.<option2> = <...>
-// loader.dispose();
-```
-
-#### onParsed
-Raised when the asset has been parsed. The `data.json` property stores the glTF JSON. The `data.bin` property stores the BIN chunk from a glTF binary or null if the input is not a glTF binary.
-
-```JavaScript
-loader.onParsed = function (data) {
-    // do something with the data
-};
-```
-
-### Version 1 Only
-
-#### IncrementalLoading
-Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
-
-```JavaScript
-BABYLON.GLTFFileLoader.IncrementalLoading = false;
-```
-
-#### HomogeneousCoordinates
-Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false.
-
-```JavaScript
-BABYLON.GLTFFileLoader.HomogeneousCoordinates = true;
-```
-
-### Version 2 Only
-
-#### coordinateSystemMode
-The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
-
-```JavaScript
-loader.coordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED;
-```
-
-#### animationStartMode
-The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
-
-```JavaScript
-loader.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.NONE;
-```
-
-#### compileMaterials
-Set to true to compile materials before raising the success callback. Defaults to false.
-
-```JavaScript
-loader.compileMaterials = true;
-```
-
-#### useClipPlane
-Set to true to also compile materials with clip planes. Defaults to false.
-
-```JavaScript
-loader.useClipPlane = true;
-```
-
-#### compileShadowGenerators
-Set to true to compile shadow generators before raising the success callback. Defaults to false.
-
-```JavaScript
-loader.compileShadowGenerators = true;
-```
-
-#### onMeshLoaded
-Raised when the loader creates a mesh after parsing the glTF properties of the mesh.
-
-```JavaScript
-loader.onMeshLoaded = function (mesh) {
-    // do something with the mesh
-};
-```
-
-#### onTextureLoaded
-Raised when the loader creates a texture 
-after parsing the glTF properties of the texture.
-
-```JavaScript
-loader.onTextureLoaded = function (texture) {
-    // do something with the texture
-};
-```
-
-#### onMaterialLoaded
-Raised when the loader creates a material after parsing the glTF properties of the material.
-
-```JavaScript
-loader.onMaterialLoaded = function (material) {
-    // do something with the material
-};
-```
-
-#### onComplete
-Raised when the asset is completely loaded, immediately before the loader is disposed.
-For assets with LODs, raised when all of the LODs are complete.
-For assets without LODs, raised when the model is complete, immediately after onSuccess.
-
-```JavaScript
-loader.onComplete = function () {
-    // do something when loading is complete
-};
-```
-
-#### dispose
-Disposes the loader, releases resources during load, and cancels any outstanding requests.
-
-```JavaScript
-// Cancel loading of the current glTF asset.
-loader.dispose();
-```