Entonces, utilicé Model Viewer de Google para mostrar archivos GLB. Pero parece estar arrojando estos errores:
>Access to fetch at 'file:///C:/Users/User/Desktop/Untitled.glb' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https. >Failed to load resource: net::ERR_FAILED >model-viewer.js:50001 TypeError: Failed to fetch at co.load (model-viewer.js:36818:3) at Mh.load (model-viewer.js:44762:10) at model-viewer.js:49881:16 at new Promise (<anonymous>) at model-viewer.js:49880:12 at Jc.preload (model-viewer.js:49988:34) at Jc.load (model-viewer.js:50018:20) at n (model-viewer.js:51575:73) at new Promise (<anonymous>) at Bu.setSource (model-viewer.js:51572:26) (anonymous) @ model-viewer.js:50001Mi código >
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script> </head> <body> <!-- Use it like any other HTML element --> <model-viewer style = "width:1050px;height:1050px;" src="Untitled.glb" camera-controls ></model-viewer> </body> </html>Y obtuve el código de este sitio web Model Viewer