|
@@ -35,6 +35,27 @@ public class OBJToGLBUtil {
|
|
|
log.info("obj转换glb完毕:" + command);
|
|
|
}
|
|
|
|
|
|
+ public static String objToB3dm(String objPath, String glbPath) {
|
|
|
+ log.info("obj转换glb开始,{}",objPath);
|
|
|
+ if(!checkObj(objPath)){
|
|
|
+ throw new BusinessException(-1,"obj文件错误");
|
|
|
+ }
|
|
|
+ log.info("obj转换glb开始");
|
|
|
+ String command = "obj2gltf -i " + objPath + " -o " + glbPath;
|
|
|
+ log.info("执行obj转换glb命令路径-{}", command);
|
|
|
+ ShellUtil.execCmd(command);
|
|
|
+ log.info("obj转换glb完毕:" + command);
|
|
|
+ return glbPath;
|
|
|
+ }
|
|
|
+ public static void objToB3dm2(String objPath,String glbPath) {
|
|
|
+ log.info("obj转换glb开始,{}",objPath);
|
|
|
+ log.info("obj转换glb开始");
|
|
|
+ String command = "obj2gltf -i " + objPath + " -o " + glbPath;
|
|
|
+ log.info("执行obj转换glb命令路径-{}", command);
|
|
|
+ ShellUtil.execCmd(command);
|
|
|
+ log.info("obj转换glb完毕:" + command);
|
|
|
+ }
|
|
|
+
|
|
|
public static boolean checkObj(String objPath) {
|
|
|
File file = new File(objPath);
|
|
|
File file1 = file.getParentFile();
|