Updated readme.md
@@ -26,8 +26,12 @@ BABYLON.SceneLoader.ImportMesh(["myMesh1", "myMesh2", "..."], "./", "duck.gltf",
In order the fix the UP vector (Y with Babylon.js) if you want to play with physics, you can customize the loader:
```
-var plugin = BABYLON.SceneLoader.GetPluginForExtension(".gltf");
-plugin.MakeYUP = true; // Which is false by default
+BABYLON.GLTFFileLoader.MakeYUP = true; // false by default
+```
+
+In order to work with homogeneous coordinates (that can be available with some converters and exporters):
+BABYLON.GLTFFileLoader.HomogeneousCoordinates = true; // false by default
## Supported features
@@ -860,9 +860,17 @@
}
else if (semantic === "POSITION") {
tempVertexData.positions = [];
- for (var j = 0; j < buffer.length; j++) {
+ var count = 3;
+ if (GLTFFileLoader.HomogeneousCoordinates) {
+ count = 4;
+ }
+ for (var j = 0; j < buffer.length; j += count) {
(<number[]>tempVertexData.positions).push(buffer[j]);
+ (<number[]>tempVertexData.positions).push(buffer[j+1]);
+ (<number[]>tempVertexData.positions).push(buffer[j+2]);
verticesCounts.push(tempVertexData.positions.length);
else if (semantic.indexOf("TEXCOORD_") !== -1) {
@@ -1658,6 +1666,7 @@
* Static members
*/
public static MakeYUP: boolean = false;
+ public static HomogeneousCoordinates: boolean = false;
/**
* Import meshes