{"id":582,"date":"2024-09-07T08:57:33","date_gmt":"2024-09-07T00:57:33","guid":{"rendered":"http:\/\/liyanliang.net\/?p=582"},"modified":"2024-09-07T08:57:33","modified_gmt":"2024-09-07T00:57:33","slug":"3dtiles%e6%95%b0%e6%8d%ae%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"http:\/\/liyanliang.net\/index.php\/2024\/09\/07\/3dtiles%e6%95%b0%e6%8d%ae%e8%a7%a3%e6%9e%90\/","title":{"rendered":"3dTiles\u6570\u636e\u89e3\u6790"},"content":{"rendered":"<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#1json\"><span class=\"toc_number toc_depth_1\">1<\/span> 1.\u89e3\u6790json\u6587\u4ef6<\/a><\/li><li><a href=\"#2b3dm\"><span class=\"toc_number toc_depth_1\">2<\/span> 2.\u89e3\u6790b3dm\u6a21\u578b<\/a><\/li><li><a href=\"#3glTF\"><span class=\"toc_number toc_depth_1\">3<\/span> 3.\u5173\u4e8eglTF\u683c\u5f0f\u8be6\u89e3<\/a><\/li><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">4<\/span> \u53c2\u8003\u8d44\u6599<\/a><ul><li><a href=\"#1json-2\"><span class=\"toc_number toc_depth_2\">4.1<\/span> 1.\u89e3\u6790json\u6587\u4ef6<\/a><\/li><li><a href=\"#23dtile-b3dm\"><span class=\"toc_number toc_depth_2\">4.2<\/span> 2.\u89e3\u67903dtile-b3dm\u683c\u5f0f<\/a><\/li><li><a href=\"#3glTF-2\"><span class=\"toc_number toc_depth_2\">4.3<\/span> 3.glTF<\/a><\/li><\/ul><\/li><\/ul><\/div>\n<h3><span id=\"1json\">1.\u89e3\u6790json\u6587\u4ef6<\/span><\/h3>\n<p>3dtiles\u7684\u6570\u636e\u7ed3\u6784\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/Tileset.png\" alt=\"Tileset\" \/><\/p>\n<h3><span id=\"2b3dm\">2.\u89e3\u6790b3dm\u6a21\u578b<\/span><\/h3>\n<p><strong>(1)b3dm\u6a21\u578b\u6587\u4ef6\u65f6\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542bglTF\u6587\u4ef6\uff1a<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/image-20220416155019332.png\" alt=\"img\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/image-20220416155052757.png\" alt=\"img\" \/><\/p>\n<p>\u5f53\u4f7f\u7528tiny_gltf\u5e93\u89e3\u6790glTF\u65f6\uff0c\u9700\u8981\u51cf\u53bb(28byte + featuretable\u7684byte + batchTable\u7684byte ):<\/p>\n<pre><code> bool TinyGLTF::ExtractGltfFromMemory(Model *model,\n                                     std::string *err,\n                                     std::string *warn,\n                                     const unsigned char *bytes,\n                                     unsigned int size,\n                                     const std::string &amp;base_dir,\n                                     unsigned int check_sections) {\n     if (size &lt; 28) {\n        if (err) {\n          (*err) = &quot;Too short data size for b3dm Binary.&quot;;\n        }\n        return false;\n      }\n\n      if (bytes[0] == &#039;b&#039; &amp;&amp; bytes[1] == &#039;3&#039; &amp;&amp; bytes[2] == &#039;d&#039; &amp;&amp;\n          bytes[3] == &#039;m&#039;) {\n        \/\/ ok\n      } else {\n        if (err) {\n          (*err) = &quot;Invalid magic.&quot;;\n        }\n        return false;\n      }\n\n      unsigned int version;                     \/\/ 4 bytes\n      unsigned int byteLength;                  \/\/ 4 bytes\n      unsigned int featureTableJSONByteLength;  \/\/ 4 bytes\n      unsigned int featureTableBinaryByteLength;\/\/ 4 bytes;\n      unsigned int batchTableJSONByteLength;    \/\/ 4 bytes\n      unsigned int batchTableBinaryByteLength;  \/\/ 4 bytes;\n\n      \/\/ @todo { Endian swap for big endian machine. }\n      memcpy(&amp;version, bytes + 4, 4);\n      swap4(&amp;version);\n      memcpy(&amp;byteLength, bytes + 8, 4);\n      swap4(&amp;byteLength);\n      memcpy(&amp;featureTableJSONByteLength, bytes + 12, 4);\n      swap4(&amp;featureTableJSONByteLength);\n      memcpy(&amp;featureTableBinaryByteLength, bytes + 16, 4);\n      swap4(&amp;featureTableBinaryByteLength);\n      memcpy(&amp;batchTableJSONByteLength, bytes + 20, 4);\n      swap4(&amp;batchTableJSONByteLength);\n      memcpy(&amp;batchTableBinaryByteLength, bytes + 24, 4);\n      swap4(&amp;batchTableBinaryByteLength);\n\n      if ((byteLength != size) || (byteLength &lt; 1) ) {\n        if (err) {\n          (*err) = &quot;Invalid b3dm binary.&quot;;\n        }\n        return false;\n      }\n\n     const int byteOffset = 28 + featureTableJSONByteLength + batchTableJSONByteLength;\n\n   \/\/ \u89e3\u6790glTF\u4e8c\u8fdb\u5236\n     bool ret = LoadBinaryFromMemory(\n           model, err, warn, &amp;bytes[byteOffset],\n           byteLength - byteOffset, base_dir, check_sections);\n\n      if (!ret) {\n        return ret;\n      }\n\n      return true;\n }<\/code><\/pre>\n<p><strong>(2)\u4f7f\u7528tiny_gltf\u5e93\u89e3\u67903dtiles\u6570\u636e<\/strong><br \/>\n\u9700\u89813\u4e2a\u6587\u4ef6stb_image.h<code>,<\/code>stb_image_write.h<code>,<\/code>json.hpp<code>\u548c<\/code>tiny_gltf.h<br \/>\n\u4f7f\u7528\u65f6\u9700\u8981\u6ce8\u610f\uff0c\u5728\u8c03\u7528#include &quot;tiny_gltf.h&quot;\u6587\u4ef6\u4e2d\u7684\u51fd\u6570\u65f6\uff0c\u9700\u8981\u6dfb\u52a0\u4e09\u4e2a\u5b8f\uff0c\u5982\uff1a<\/p>\n<pre><code> \/\/ Define these only in *one* .cc file.\n #define TINYGLTF_IMPLEMENTATION\n #define STB_IMAGE_IMPLEMENTATION\n #define STB_IMAGE_WRITE_IMPLEMENTATION\n \/\/ #define TINYGLTF_NOEXCEPTION \/\/ optional. disable exception handling.\n #include &quot;tiny_gltf.h&quot;\n\n using namespace tinygltf;\n\n Model model;\n TinyGLTF loader;\n std::string err;\n std::string warn;\n\n bool ret = loader.LoadASCIIFromFile(&amp;model, &amp;err, &amp;warn, argv[1]);\n \/\/bool ret = loader.LoadBinaryFromFile(&amp;model, &amp;err, &amp;warn, argv[1]); \/\/ for binary glTF(.glb)\n\n if (!warn.empty()) {\n   printf(&quot;Warn: %s\\n&quot;, warn.c_str());\n }\n\n if (!err.empty()) {\n   printf(&quot;Err: %s\\n&quot;, err.c_str());\n }\n\n if (!ret) {\n   printf(&quot;Failed to parse glTF\\n&quot;);\n   return -1;\n }<\/code><\/pre>\n<h3><span id=\"3glTF\">3.\u5173\u4e8eglTF\u683c\u5f0f\u8be6\u89e3<\/span><\/h3>\n<pre><code> {\n   &quot;scenes&quot; : [ \/\/ \u53ea\u5305\u542b\u4e86\u4e00\u4e2a\u573a\u666f\n     {\n       &quot;nodes&quot; : [ 0, 1]\n     }\n   ],\n   &quot;nodes&quot; : [ \/\/ \u5c06mesh\u5bf9\u8c61\u9644\u7740\u5230\u4e24\u4e2a\u4e0d\u540c\u7684node\u5bf9\u8c61\uff0c\u5c06\u5176\u6e32\u67d3\u4e86\u4e24\u6b21\n     {\n       &quot;mesh&quot; : 0\n     },\n     {\n       &quot;mesh&quot; : 0,\n       &quot;translation&quot; : [ 1.0, 0.0, 0.0 ] \/\/ \u4f7f\u7528translation\u5c5e\u6027\u6765\u5c06mesh\u5bf9\u8c61\u7684\u6e32\u67d3\u4f4d\u7f6e\u79fb\u52a8\u5230\u5176\u5b83\u5730\u65b9\n       &quot;rotation&quot;: [ 0.259, 0.0, 0.0, 0.966 ], \/\/ \u56db\u5143\u6570\n       &quot;scale&quot;: [ 2.0, 1.0, 0.5 ] \/\/ x\uff0cy\u548cz\u8f74\u7684\u7f29\u653e\u7cfb\u6570\n       \/\/ \u6216\u8005\u53ea\u7ed9\u51fa\u4e00\u4e2amatrix\u8fdb\u884c\u53d8\u6362\n       &quot;matrix&quot;: [ \/\/ \u63cf\u8ff0\u4e86\u4e00\u4e2a\u7f29\u653e(2,1,0.5)\uff0c\u7ed5x\u8f74\u65cb\u8f6c30\u5ea6\uff0c\u5e73\u79fb(10,20,30)\u7684matrix\u5c5e\u6027\n         2.0,    0.0,    0.0,    0.0,\n         0.0,    0.866,  0.5,    0.0,\n         0.0,   -0.25,   0.433,  0.0,\n         10.0,   20.0,   30.0,    1.0\n     ]\n     } \n   ],\n\n   &quot;meshes&quot; : [\n     {\n       &quot;primitives&quot; : [ {\n         &quot;attributes&quot; : {\n           &quot;POSITION&quot; : 1, \/\/ \u5f15\u7528\u4e86\u7d22\u5f15\u4e3a1\u7684accessor\u5bf9\u8c61\n           &quot;NORMAL&quot; : 2 \/\/ &quot;NORMAL&quot;\u5c5e\u6027\u5f15\u7528\u4e86\u7d22\u5f15\u4e3a2\u7684accessor\u5bf9\u8c61\n         },\n         &quot;indices&quot; : 0\n       } ]\n     }\n   ],\n\n   &quot;buffers&quot; : [ \/\/ \u8868\u793a\u4e86\u4e00\u4e2a\u6ca1\u6709\u4efb\u4f55\u5c42\u6b21\u7ed3\u6784\u548c\u610f\u4e49\u7684\u4e8c\u8fdb\u5236\u6570\u636e\u5757\n     {\n       &quot;uri&quot; : &quot;data:application\/octet-stream;base64,AAA\u4e3a\u4e86\u6392\u7248\u800c\u5220\u9664\uff0c\u53ef\u4ee5\u4f7f\u7528\u82f1\u6587\u539f\u6587\u4e2d\u7684\u4ee3\u7801=&quot;,\n       &quot;byteLength&quot; : 80 \/\/ \u4f7f\u7528\u4e86\u5927\u5c0f\u4e3a80\u5b57\u8282\u7684\u7ecf\u8fc7\u7f16\u7801\u7684\u6570\u636eURI\u4f5c\u4e3a\u7f13\u51b2\u7684\u6570\u636e\n     }\n   ],\n   &quot;bufferViews&quot; : [ \/\/ \u4e00\u4e2abufferView\u5bf9\u8c61\u4ee3\u8868\u4e86\u4e00\u4e2abuffer\u5bf9\u8c61\u7684\u90e8\u5206\u6570\u636e\n     {\n       &quot;buffer&quot; : 0,\n       &quot;byteOffset&quot; : 0,\n       &quot;byteLength&quot; : 6, \/\/ \u5f15\u7528\u4e86\u7d22\u5f15\u4e3a0\u7684buffer\u5bf9\u8c61\u7684\u524d6\u4e2a\u5b57\u8282\u7684\u6570\u636e\n       &quot;target&quot; : 34963 \/\/ \u8868\u793a\u6570\u636e\u4f7f\u7528\u65b9\u5f0f\u7684\u5e38\u91cf,ELEMENT_ARRAY_BUFFER\n     },\n     {\n       &quot;buffer&quot; : 0,\n       &quot;byteOffset&quot; : 8,\n       &quot;byteLength&quot; : 72, \/\/ \u4ece\u504f\u79fb\u503c8\u5f00\u59cb\u768436\u4e2a\u5b57\u8282\u7684buffer\u5bf9\u8c61\u7684\u6570\u636e\n       &quot;target&quot; : 34962 \/\/ ARRAY_BUFFER\n     }\n   ],\n   &quot;accessors&quot; : [\n     {  \/\/ \u8868\u793a\u9876\u70b9\u7d22\u5f15\u6570\u636e\u662funsigned short\u7c7b\u578b\u7684\u6807\u91cf\n       &quot;bufferView&quot; : 0, \/\/ \u5f15\u7528\u4e86\u7d22\u5f15\u4e3a0\u7684bufferView,\u8fd9\u4e00bufferView\u5bf9\u8c61\u63cf\u8ff0\u4e86buffer\u6570\u636e\u4e2d\u7684\u9876\u70b9\u7d22\u5f15\u6570\u636e\n       &quot;byteOffset&quot; : 0,  \/\/ \u6307\u5b9a\u4e86accessor\u6240\u8bbf\u95ee\u6570\u636e\u7684\u5f00\u59cb\u4f4d\u7f6e\n       &quot;componentType&quot; : 5123, \/\/ \u5b9a\u4e49\u4e86\u6570\u636e\u5206\u91cf\u7684\u57fa\u7840\u7c7b\u578b,5123\u4ee3\u8868UNSIGNED_SHORT\u3002\u540cshort\u5360\u75282\u4e2a\u5b57\u8282\n       &quot;count&quot; : 3, \/\/ count\u5c5e\u6027\u6307\u5b9a\u4e86\u6570\u636e\u5143\u7d20\u7684\u6570\u91cf,\u5bf9\u5e94\u4e09\u89d2\u5f62\u76843\u4e2a\u9876\u70b9\u7684\u7d22\u5f15\u503c\n       &quot;type&quot; : &quot;SCALAR&quot;, \n       &quot;max&quot; : [ 2 ],\n       &quot;min&quot; : [ 0 ]\n     },\n     {  \/\/ \u8fd9\u4e00accessor\u5bf9\u8c61\u63cf\u8ff0\u4e86\u5206\u91cf\u7c7b\u578b\u4e3afloat\u76843D\u5411\u91cf\u6570\u636e\n       &quot;bufferView&quot; : 1,\n       &quot;byteOffset&quot; : 0,  \/\/ \u6307\u5b9a\u4e86accessor\u6240\u8bbf\u95ee\u6570\u636e\u7684\u5f00\u59cb\u4f4d\u7f6e\n       &quot;componentType&quot; : 5126, \/\/ 5126\u4ee3\u8868FLOAT,\u4e00\u4e2afloat\u7c7b\u578b\u503c\u53604\u4e2a\u5b57\u8282\n       &quot;count&quot; : 3, \/\/ count\u5c5e\u6027\u6307\u5b9a\u4e86\u6570\u636e\u5143\u7d20\u7684\u6570\u91cf\n       &quot;type&quot; : &quot;VEC3&quot;,\n       &quot;max&quot; : [ 1.0, 1.0, 0.0 ], \/\/ min\u548cmax\u5c5e\u6027\u5b9a\u4e49\u4e863D\u5bf9\u8c61\u7684\u5305\u56f4\u76d2\n       &quot;min&quot; : [ 0.0, 0.0, 0.0 ]\n     },\n     {\n       &quot;bufferView&quot; : 1,\n       &quot;byteOffset&quot; : 36,\n       &quot;componentType&quot; : 5126, \/\/ 5126\u4ee3\u8868FLOAT\n       &quot;count&quot; : 3, \/\/ count\u5c5e\u6027\u6307\u5b9a\u4e86\u6570\u636e\u5143\u7d20\u7684\u6570\u91cf\n       &quot;type&quot; : &quot;VEC3&quot;,\n       &quot;max&quot; : [ 0.0, 0.0, 1.0 ], \/\/ min\u548cmax\u5c5e\u6027\u5b9a\u4e49\u4e863D\u5bf9\u8c61\u7684\u5305\u56f4\u76d2\n       &quot;min&quot; : [ 0.0, 0.0, 1.0 ]\n     }\n   ],\n\n   &quot;asset&quot; : {\n     &quot;version&quot; : &quot;2.0&quot;\n   }\n }<\/code><\/pre>\n<h3><span id=\"i\">\u53c2\u8003\u8d44\u6599<\/span><\/h3>\n<h4><span id=\"1json-2\">1.\u89e3\u6790json\u6587\u4ef6<\/span><\/h4>\n<p>Reference:<\/p>\n<p>RapidJSON\u7684\u7b80\u5355\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/fengbingchun\/article\/details\/91139889\">RapidJSON\u7b80\u4ecb\u53ca\u4f7f\u7528<\/a><\/p>\n<h4><span id=\"23dtile-b3dm\">2.\u89e3\u67903dtile-b3dm\u683c\u5f0f<\/span><\/h4>\n<p>Reference\uff1a<\/p>\n<p>(1)\u5bf9\u76f8\u5173\u8d44\u6599\u505a\u4e86\u603b\u7ed3\u548c\u63a8\u8350\uff1a<\/p>\n<p><a href=\"https:\/\/www.cxymm.net\/article\/github_38885296\/116408826\">Cesium\u4e4bb3dm\u683c\u5f0f_\u5168\u6808\u7a7a\u95f4-\u7a0b\u5e8f\u5458\u79d8\u5bc6<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/image-20220414105546750.png\" alt=\"image-20220414105546750\" \/><\/p>\n<p>(2)\u5bf9b3dm\u4e8c\u8fdb\u5236\u7ed3\u6784\u505a\u4e86\u8be6\u7ec6\u7684\u89e3\u6790\uff1a<\/p>\n<p><a href=\"https:\/\/www.cnblogs.com\/onsummer\/p\/13252896.html\">3dTiles \u6570\u636e\u89c4\u8303\u8be6\u89e3[4.1] b3dm\u74e6\u7247\u4e8c\u8fdb\u5236\u6570\u636e\u6587\u4ef6\u7ed3\u6784 _<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/image-20220414105705179.png\" alt=\"image-20220414105705179\" \/><\/p>\n<p>(3)\u5b98\u7f51\u5bf9Batched3DModel\u7684\u4ecb\u7ecd<\/p>\n<p><a href=\"https:\/\/github.com\/CesiumGS\/3d-tiles\/tree\/main\/specification\/TileFormats\/Batched3DModel#binary-gltf\">3d-tiles\/specification\/TileFormats\/Batched3DModel\/<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/layout.png\" alt=\"layout.png\" \/><\/p>\n<p>(4)3dtiles\u5b98\u65b9\u89c4\u8303<\/p>\n<p><a href=\"https:\/\/github.com\/CesiumGS\/3d-tiles\/tree\/main\/specification\">3d-tiles\/specification<\/a><\/p>\n<p>(5)<\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/Rsoftwaretest\/article\/details\/90667628\">3dTile \u6570\u636e\u6587\u4ef6\u683c\u5f0f\u8bf4\u660e<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1Jzb2Z0d2FyZXRlc3Q=,size_16,color_FFFFFF,t_70.png\" alt=\"img\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1Jzb2Z0d2FyZXRlc3Q=,size_16,color_FFFFFF,t_70-20220414111830369.png\" alt=\"img\" \/><\/p>\n<p>(6)3dtiles\u89c4\u8303\u4e2d\u6587\u7248pdf<\/p>\n<p>\u94fe\u63a5: <a href=\"https:\/\/pan.baidu.com\/s\/1hhbvD_2DXrPCTOs7slsNHA\">https:\/\/pan.baidu.com\/s\/1hhbvD_2DXrPCTOs7slsNHA<\/a> \u63d0\u53d6\u7801: ejm7<\/p>\n<h4><span id=\"3glTF-2\">3.glTF<\/span><\/h4>\n<p>(1)glTF\u5b98\u65b9github:<\/p>\n<p><a href=\"https:\/\/github.com\/KhronosGroup\/glTF\">KhronosGroup\/glTF<\/a><\/p>\n<p>(2)glTF\u89c4\u8303\uff1a<\/p>\n<p><a href=\"https:\/\/github.com\/KhronosGroup\/glTF\/blob\/main\/specification\/2.0\/Specification.adoc#glb-file-format-specification\"><strong>Specification.adoc<\/strong><\/a><\/p>\n<p>(3)\u5bf9glTF\u683c\u5f0f\u7684\u8be6\u7ec6\u4ecb\u7ecd,\u6559\u7a0b(glTF\u5b98\u65b9\u6587\u6863\u7ffb\u8bd1)<\/p>\n<p><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/65265611\">glTF\u683c\u5f0f\u8be6\u89e3(glTF\u683c\u5f0f\u57fa\u672c\u7ed3\u6784)<\/a><\/p>\n<p>(4)\u535a\u4e3b\u7684github\u5199\u4e86\u4e00\u4e2a\u89e3\u6790glTF\u7684\u5de5\u5177\uff1a<\/p>\n<p><a href=\"https:\/\/zhuanlan.zhihu.com\/p\/108589230\">\u6a21\u578b\u5bfc\u5165\u4e4b\u4f18\u96c5\u59ff\u52bf\u2014\u2014glTF<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/songchaow\/toy-renderer\/blob\/master\/toy_tracer\/core\/glTFLoader.cpp\">songchaow\/toy-renderer<\/a><\/p>\n<p>(5)\u89e3\u6790b3dm\u6a21\u578b\u7684\u5e93tiny_gltf(\u9879\u76ee\u4e2d\u7528\u8fd9\u4e2a\u5e93\u89e3\u6790)<\/p>\n<p><a href=\"https:\/\/github.com\/fanvanzh\/3dtiles\">https:\/\/github.com\/fanvanzh\/3dtiles<\/a><\/p>\n<p>(6)tiny_gltf\u539f\u59cb\u9879\u76ee\u51fa\u5904\uff1a<\/p>\n<p><a href=\"https:\/\/github.com\/chainblocks\/tinygltf\">chainblocks\/tinygltf<\/a><\/p>\n<p>(7)glTF\u6a21\u578b\u6587\u4ef6\u8bb2\u89e3(B\u7ad9)<\/p>\n<p><a href=\"https:\/\/www.bilibili.com\/video\/BV1bm4y1S7rK?spm_id_from=333.337.search-card.all.click\">\u3010\u65e5\u5e38 | \u5b66\u4e60Vlog | \u7a0b\u5e8f\u5a9b\u4e50\u4e50\u3011\u6570\u5b57\u5b6a\u751f\u57fa\u7840 | \u4e09\u7ef4\u6a21\u578b | What is glTF?<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/liyanliangpublic.oss-cn-hongkong.aliyuncs.com\/img\/image-20220415101428317.png\" alt=\"image-20220415101428317\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Contents1 1.\u89e3\u6790json\u6587\u4ef62 2.\u89e3\u6790b3dm\u6a21\u578b3 3.\u5173\u4e8eglTF\u683c\u5f0f\u8be6\u89e34 \u53c2\u8003\u8d44\u65994.1 1.\u89e3\u6790json\u6587\u4ef64.2 2.\u89e3\u67903dtile-b3dm\u683c\u5f0f4.3 3.glTF 1.\u89e3\u6790json\u6587\u4ef6 3dtiles\u7684\u6570\u636e\u7ed3\u6784\uff1a 2.\u89e3\u6790b3dm\u6a21\u578b (1)b3dm\u6a21\u578b\u6587\u4ef6\u65f6\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542bglTF\u6587\u4ef6\uff1a \u5f53\u4f7f\u7528tiny_gltf\u5e93\u89e3\u6790glTF\u65f6\uff0c\u9700\u8981\u51cf\u53bb(28byte + featuretable\u7684byte + batchTable\u7684byte ): bool TinyGLTF::ExtractGltfFromMemory(Model *model, std::string *err, std::string *warn, const unsigned char *bytes, unsigned int size, const std::string &amp;base_dir, unsigned int check_sections) { if (size &lt; 28) { if (err) { (*err) = &quot;Too short data si&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"http:\/\/liyanliang.net\/index.php\/2024\/09\/07\/3dtiles%e6%95%b0%e6%8d%ae%e8%a7%a3%e6%9e%90\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":583,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[59,55],"class_list":["post-582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gis","tag-3dtiles","tag-gltf"],"_links":{"self":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/comments?post=582"}],"version-history":[{"count":1,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":584,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/582\/revisions\/584"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/media\/583"}],"wp:attachment":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/media?parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/categories?post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/tags?post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}