فهرست منبع

场景obj模型转换为b3dm

lyhzzz 1 سال پیش
والد
کامیت
a293431580

+ 2 - 2
src/main/java/com/fdkankan/fusion/common/util/OBJToGLBUtil.java

@@ -41,7 +41,7 @@ public class OBJToGLBUtil {
             throw new BusinessException(-1,"obj文件错误");
         }
         log.info("obj转换b3dm开始");
-        String command = "Obj2Tiles --stage Decimation --lods 8 " + objPath + " " + glbPath;
+        String command = "Obj2Tiles --lods 8 --divisions 3 " + objPath + " " + glbPath;
         log.info("执行obj转换glb命令路径-{}", command);
         ShellUtil.execCmd(command);
         log.info("obj转换b3dm完毕:" + command);
@@ -50,7 +50,7 @@ public class OBJToGLBUtil {
     public static void objToB3dm2(String objPath,String glbPath)  {
         log.info("obj转换b3dm开始,{}",objPath);
         log.info("obj转换b3dm开始");
-        String command = "Obj2Tiles --stage Decimation --lods 8 " + objPath + " " + glbPath;
+        String command = "Obj2Tiles --lods 8 --divisions 3 " + objPath + " " + glbPath;
         log.info("执行obj转换b3dm命令路径-{}", command);
         ShellUtil.execCmd(command);
         log.info("obj转换b3dm完毕:" + command);

+ 2 - 1
src/main/java/com/fdkankan/fusion/service/impl/ThreadService.java

@@ -80,9 +80,10 @@ public class ThreadService {
 
             String name = file1.getName();
             if(name.contains("obj") || name.contains("OBJ")){
-                String localPath = FilePath.LOCAL_BASE_PATH +  String.format(FilePath.MODEL_OSS_PATH,environment, model.getModelId())+"/b3dm";
                 model.setModelDateType("b3dm");
                 model.setModelType("b3dm");
+                String localPath = file1.getParentFile().getParentFile().getPath()+"/b3dm";
+
                 OBJToGLBUtil.objToB3dm2(file1.getPath(),localPath);
                 redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
                 ossPath = localPath.replace("/mnt/","");