<div dir="ltr"><div dir="ltr"><div dir="ltr">My experience implementing glTF loading and rendering in freewrl:<div>-Doug</div><div>RESULTS:</div><div><br style="color:rgb(32,31,30);font-size:14.6667px"><a href="http://dug9.users.sourceforge.net/web3d/tests/gltf/gltf_june22_2020.jpg" target="_blank" rel="noopener noreferrer" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14.6667px;line-height:inherit;vertical-align:baseline">http://dug9.users.sourceforge.net/web3d/tests/gltf/gltf_june22_2020.jpg</a><br style="color:rgb(32,31,30);font-size:14.6667px"><span style="color:rgb(32,31,30);font-size:14.6667px">- we can load directly as scene, or inline .gltf and.glb</span><br style="color:rgb(32,31,30);font-size:14.6667px"><span style="color:rgb(32,31,30);font-size:14.6667px">x our physical diffuse texture isn't showing up correctly</span><br style="color:rgb(32,31,30);font-size:14.6667px"><span style="color:rgb(32,31,30);font-size:14.6667px">- view3dscene is great at loading gltf</span><br style="color:rgb(32,31,30);font-size:14.6667px"><a href="http://dug9.users.sourceforge.net/web3d/tests/gltf/box_mat.gltf.glb" target="_blank" rel="noopener noreferrer" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14.6667px;line-height:inherit;vertical-align:baseline">http://dug9.users.sourceforge.net/web3d/tests/gltf/box_mat.gltf.glb</a><br style="color:rgb(32,31,30);font-size:14.6667px"><a href="http://dug9.users.sourceforge.net/web3d/tests/gltf/separate_test.gltf" target="_blank" rel="noopener noreferrer" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14.6667px;line-height:inherit;vertical-align:baseline">http://dug9.users.sourceforge.net/web3d/tests/gltf/separate_test.gltf</a><br style="color:rgb(32,31,30);font-size:14.6667px"><a href="http://dug9.users.sourceforge.net/web3d/tests/gltf/texture/TextureCoordinateTest.gltf" target="_blank" rel="noopener noreferrer" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14.6667px;line-height:inherit;vertical-align:baseline">http://dug9.users.sourceforge.net/web3d/tests/gltf/texture/TextureCoordinateTest.gltf</a><br style="color:rgb(32,31,30);font-size:14.6667px"><span style="color:rgb(32,31,30);font-size:14.6667px">- a texture test from:</span><br style="color:rgb(32,31,30);font-size:14.6667px"><a href="https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TextureCoordinateTest" target="_blank" rel="noopener noreferrer" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14.6667px;line-height:inherit;vertical-align:baseline">https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TextureCoordinateTest</a><span style="color:rgb(32,31,30);font-size:14.6667px"></span><br style="color:rgb(32,31,30);font-size:14.6667px"><br></div><div>TIME</div><div>9 days to get a bit rendering - 90% of that was to find ways / places to integrate into freewrl spaghetti C code base.</div><div><br></div><div>METHOD</div><div>BufferGeometry node (as Andreas mentioned x3dom uses) allowed me to bypass some freewrl spaghetti C and save some time.</div><div><span style="color:rgb(32,31,30);font-size:14.6667px"> i used cgltf </span><a href="https://github.com/jkuhlmann/cgltf" target="_blank" rel="noopener noreferrer" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14.6667px;line-height:inherit;vertical-align:baseline">https://github.com/jkuhlmann/cgltf</a><br></div><div>- .h file in C99 allows quick and easy parsing into C structs</div><div>Lazy loading - .glb contains .ibin, but JSON .gltf separate needs a .,bin binary file with the geometry buffers. I found there's enough information in the JSON .gltf to create all the x3d scene nodes, and each geom node gets a pointer to a gltf unit struct I made with a flag saying when the .bin has been loaded and post-applied to the cgltf struct .data. When the geom node sees bin has been loaded and applied, then it compiles and starts rendering.</div><div>- i hacked the cgltf bin loader to separate out file loading, to integrate into freewrl http pull system, so it can get .bin even when on a remote server.</div><div><br></div></div></div></div>