改变A-Frame中glTF对象的不透明度

时间:2018-02-13 21:12:27

标签: aframe

我试图使用<a-animate>来改变glTF模型(invertedsphere9.glb)的不透明度。

我试图添加一个材质组件并改变它的不透明度,但感觉我正在做的是创建一个新的空材质。

如何访问对象的材质组件以更改不透明度?

   <html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta charset="utf-8" />
    <title>Hello, World! • A-Frame</title>
    <meta name="description" content="Hello, World! • A-Frame" />
    <script src="../../../dist/aframe-master.js"></script>
  </head>
  <body class="a-body "><script type="text/javascript" src="//25.13.175.79:35729/livereload.js?snipver=1" async="" defer="defer"></script><script type="text/javascript" src="//25.13.175.79:35729/livereload.js?snipver=1" async="" defer="defer"></script><script type="text/javascript" src="//25.13.175.79:35729/livereload.js?snipver=1" async="" defer="defer"></script><script type="text/javascript" src="//25.13.175.79:35729/livereload.js?snipver=1" async="" defer="defer"></script><script type="text/javascript" src="//25.13.175.79:35729/livereload.js?snipver=1" async="" defer="defer"></script>
    <a-scene class="fullscreen" inspector="" keyboard-shortcuts="" screenshot="" vr-mode-ui="">
      <a-entity gltf-model="model/invertedsphere.glb" scale="8 8 8"></a-entity>
      <a-entity>
        <a-entity gltf-model="model/invertedsphere9.glb" scale="10 10 10" rotation="0 160 0"></a-entity>
        <a-animation attribute="opacity" from="0" to="100" repeat="indefinite">
      </a-entity>
      <a-entity rotation="0 0 0">
        <a-plane src="model/tex/floor.png" height="10" width="10" rotation="-90 -2 0" material="transparent:true"></a-plane>
        <a-animation attribute="rotation" dur="9900" easing="linear" fill="forwards" to="0 360 0" repeat="indefinite"></a-animation>
      </a-entity>
        <a-plane src="model/tex/aetheria.png" height="1" width="4.25" position="0 2 -4" material="transparent:true"></a-plane>
    </a-scene>
</body></html>

0 个答案:

没有答案