unity 將檔案匯出成Obj格式儲存在任意位置

2021-08-11 03:17:08 字數 1093 閱讀 3117

優勢是可以儲存在任意位置,只要可以就可以。親測可用移動端和pc端,應該是都可以的,因為可以存在沙盒中~~~~

劣勢暫時還不知道,可能obj不支援其他一些3d引擎吧。。。

方法很簡單,直接呼叫creatmesh,傳參即可。

嗯 就這樣吧 這個比較簡單 就不說太多了,具體的轉化資料的那個方法,大家感興趣可以自己測試

方法我是在網上找的,大家可以找找原著,我就不厚臉皮了~~~~~

大家可以一塊交流有什麼問題的話新增 qq群 207019099

/// /// 儲存檔案到沙盒中

///

public static void creatmesh(string path, string meshname, mesh ms)

using (streamwriter streamwriter = new streamwriter(path + meshname))

}/// /// mesh轉化為資料

///

///

///

///

public static string meshtostring(mesh mf, vector3 scale)

dictionarydictionary = new dictionary();

if (mesh.submeshcount > 1)

if (!dictionary.containskey(********s[j + 1]))

if (!dictionary.containskey(********s[j + 2]))}}

for (int num = 0; num != mesh.uv.length; num++)

else

}for (int k = 0; k < mesh.submeshcount; k++)

if (k == 1)

int ********s2 = mesh.get********s(k);

for (int l = 0; l < ********s2.length; l += 3)

}return stringbuilder.tostring();

}

Unity匯出場景地形網格到 obj檔案

當美術同事拼接好場景內容後,需要在指定場景上製作具體的行走麵時,用來提供網格參照。主要 邏輯就是將場景內帶mesh的結點記錄下來,通過對應的.obj資料格式進行儲存。具體 using unityengine using system.collections using system.io using...

java 將查詢的資料匯出成excel檔案

controller 層 匯出excel param globalid param createtime public void findsigndataexport string globalid,string createtime,httpservletrequest request,https...

將sas dataset 匯出至Excel格式

ods excel file filepath.xlsx options absolute column width none 列寬 absolute row height 20 行高 center horizontal off center vertical off embed footnotes...