use of com.ardor3d.math.Quaternion in project energy3d by concord-consortium.
the class Scene method exportObj.
public void exportObj(final File file) throws Exception {
try {
final List<Mesh> objs = new ArrayList<Mesh>();
for (final HousePart part : parts) {
part.addPrintMeshes(objs);
}
final Quaternion rotate = new Quaternion(-1, 0, 0, 1);
for (final Mesh mesh : objs) {
mesh.getMeshData().rotatePoints(rotate);
if (mesh.getMeshData().getNormalBuffer() != null) {
mesh.getMeshData().rotateNormals(rotate);
}
mesh.updateModelBound();
}
final String s = file.toString();
new ObjExporter().save(objs, new File(s), new File(s.substring(0, s.lastIndexOf(".")) + ".mtl"), null);
} catch (final Throwable t) {
BugReporter.report(t);
}
}
Aggregations