简体   繁体   English

Model 查看器库不加载 3d model

[英]Model Viewer library does not load the 3d model

I am trying to load a 3d model into my website using the modelviewer library.我正在尝试使用 modelviewer 库将 3d model 加载到我的网站中。 However, the file it not loading and I am getting the below (see image).但是,它没有加载的文件,我得到了下面的(见图)。

FYI if it could be causing some issues - I am using github pages, but hosting a custom domain that I purchased from godaddy.仅供参考,如果它可能导致一些问题 - 我正在使用 github 页面,但托管我从 godaddy 购买的自定义域。

I thought that it was a permission issue, but I tried adding my.glb model to the folder and then downloading it by going to (example: www.website.com/origami.glb ) and it downloaded.我认为这是一个权限问题,但我尝试将 my.glb model 添加到文件夹中,然后通过转到(例如: www.website.com/origami.glb )下载它并下载。

Here is my code:这是我的代码:

<!DOCTYPE html>
<html style="font-size: 100%;">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>test</title>
        <link rel="stylesheet" href="./styles/styles.css" id="" type="text/css">
        <link rel="stylesheet" href="./styles/stylesMob.css" id="" type="text/css">
        <link rel="stylesheet" href="./styles/navStyle.css" id="" type="text/css">
        <link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'>   
        <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>   

        <style>
        model-viewer{
            width: 400px;
            height: 1600px;
            margin: auto;
        }   

        </style>
        
    </head>

    <body>
        <ul>
            <li><a  href="index.html">main</a></li>
            <li><a class="active" href="projects.html">projects</a></li>
            <li><a href="about.html">about</a></li>
            <li><a href="about.html">contact</a></li>
          </ul>
          
        
        <h4 style="font-size: 20px; color: red;"> * the website is wip * </h4>
        <div>
            <model-viewer src="origami.glb" ></model-viewer>
        </div>            
       

        
    </body>
</html>

在此处输入图像描述

在此处输入图像描述

You can check this here model is showing.你可以在这里查看 model 显示。

 <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script> <model-viewer src="http://raw.githubusercontent.com/german-alvarez-dev/workshop-webvr-aframe/master/ship/scene_ship.gltf" auto-rotate alt="boat"> </model-viewer>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM