将纹理分配到OBJ文件

时间:2019-02-05 11:57:17

标签: html

我正在尝试通过Web显示3D模型(.obj文件)。但是我不能赋予它纹理。我该怎么办?

谢谢。

    body { background-color: #000; overflow: hidden; }
    #info {
            color: #fff;
            top: 10px;
            width: 100%;
            height: 150px;
            text-align: center;
            z-index: 100;
            display:block;
        }
        h1 { font-size: 20px}
    </style>
</head>

<body>
<div id="info">
     <h1>hoyo</h1>
     <h2>prueba</h2>
     <p>
    nadir<br>

     </p>

<div style="width:640px; margin:auto; color: #000;">
    <canvas id="cav" width="1000" height="750"></canvas>
</div>
<script type="text/javascript" src="OBJ_files/jsc3d_002.js"></script>
<script type="text/javascript" src="OBJ_files/jsc3d_003.js"></script>
<script type="text/javascript" src="OBJ_files/jsc3d.js"></script>
<script type="text/javascript">
var canvas = document.getElementById('cav');
var viewer = new JSC3D.Viewer(canvas);
viewer.setParameter('SceneUrl', '1.obj');
viewer.setParameter('InitRotationX', 0);
viewer.setParameter('InitRotationY', 0);
viewer.setParameter('InitRotationZ', 0);
viewer.setParameter('BackgroundColor1', '#000000');
viewer.setParameter('BackgroundColor2', '#000000');
viewer.setParameter('RenderMode', 'texturesmooth');
viewer.setParameter('MipMapping', 'on');
viewer.setParameter('ProgressBar', 'on');
viewer.setParameter('Renderer', 'webgl');
    viewer.setParameter('Definition', 'standard');
viewer.init();
viewer.update();

     正在加载MTL文件...         JSC3D的Modelo 3D技术和SfM的公共实体化

0 个答案:

没有答案