|
@@ -16,7 +16,7 @@ export class OBJExport {
|
|
* @param materials defines if materials should be exported
|
|
* @param materials defines if materials should be exported
|
|
* @param matlibname defines the name of the associated mtl file
|
|
* @param matlibname defines the name of the associated mtl file
|
|
* @param globalposition defines if the exported positions are globals or local to the exported mesh
|
|
* @param globalposition defines if the exported positions are globals or local to the exported mesh
|
|
- * @param sceneUsesRightHandedSystem defines if the babylon scene is right handed, in this case the exported obj X vertices won't be inverted
|
|
|
|
|
|
+ * @param sceneUsesRightHandedSystem defines if the babylon scene is right handed, in this case the exported obj X vertices won't be inverted
|
|
* @returns the OBJ content
|
|
* @returns the OBJ content
|
|
*/
|
|
*/
|
|
public static OBJ(mesh: Mesh[], materials?: boolean, matlibname?: string, globalposition?: boolean, sceneUsesRightHandedSystem?: boolean): string {
|
|
public static OBJ(mesh: Mesh[], materials?: boolean, matlibname?: string, globalposition?: boolean, sceneUsesRightHandedSystem?: boolean): string {
|
|
@@ -70,7 +70,7 @@ export class OBJExport {
|
|
for (var i = 0; i < trunkVerts.length; i += 3) {
|
|
for (var i = 0; i < trunkVerts.length; i += 3) {
|
|
// Babylon default is left handed, while OBJ default is right handed
|
|
// Babylon default is left handed, while OBJ default is right handed
|
|
// By default we serialize in OBJ inverting the X vertices
|
|
// By default we serialize in OBJ inverting the X vertices
|
|
- if(sceneUsesRightHandedSystem) {
|
|
|
|
|
|
+ if (sceneUsesRightHandedSystem) {
|
|
output.push("v " + trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
|
|
output.push("v " + trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
|
|
} else {
|
|
} else {
|
|
output.push("v " + -trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
|
|
output.push("v " + -trunkVerts[i] + " " + trunkVerts[i + 1] + " " + trunkVerts[i + 2]);
|