Node.js gLTF 2.0型号未在A型架中显示

Node.js gLTF 2.0型号未在A型架中显示,node.js,blender,aframe,gltf,Node.js,Blender,Aframe,Gltf,我从Kronos Github下载了这个插件,并将它添加到Blender中 <!-- Primitives. --> <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box> <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere> <a-cyl

我从Kronos Github下载了这个插件,并将它添加到Blender中

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
然后,我从Blender导出了一个简单的起始立方体,并将其命名为“test.gltf”(我也尝试过“test.gbl”),然后将其放置在a帧场景中

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
我使用的是A帧母版(不是0.70)

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
代码如下:

<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta charset="utf-8" />
<title>Aetheria</title>
<meta name="description" content="Aetheria" />
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
我能够在Microsoft的3D Builder中查看模型,并且确实可以看到一个普通的灰色起始立方体

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
如何使我的glTF模型可见

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>

据我所知,a-frame 0.6.0在glTF模型组件中使用了glTF 1.0。
  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
如果要参照主生成,请确保使用

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>
<script src="https://aframe.io/releases/0.7.1/aframe.min.js"></script>

这是今天的主分支

  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>


否则,请使用glTF 1.0导出器。

在.glTF旁边还有其他导出文件。(a.垃圾箱、纹理)。您是否将它们与.gltf一起放在您的服务器上?@piotradamilewski是的。在这种情况下,没有纹理,但服务器上有一个testing.gltf和一个testing.bin。这是一个故障服务器,还是你自己的?@Piotradamilewski我自己的服务器,我在ubuntu 14.04上使用npm和livereload。等等,你是使用a-frame主机还是a-frame 0.6.0?看起来我安装了0.7.1,但是
angle initscene
正在为A-Frame 0.6.0创建项目场景,因此出现了问题。从现在起,我将手动创建场景。谢谢你的帮助!
  <!-- Primitives. -->
  <a-box position="-1 0.6 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
  <a-sphere position="0 1.35 -5" radius="1.25" color="#EF2D5E"></a-sphere>
  <a-cylinder position="1 0.85 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
  <a-plane position="0 0.1 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
  <a-gltf-model src="model/invertedsphere/test.gltf"></a-gltf-model>

  <!-- Background sky. -->
  <a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>

  <!-- Ground. -->



</a-scene>