2017-07-07 9 views
1

Aフレームのイベントセットコンポーネントプラグインを使用してcolladaオブジェクト上に回転アニメーションを作成しようとしていますが、 -boxは、代わりにcolladaオブジェクトをアニメートしたいと思います。何らかの理由で私はcolladaオブジェクトを見ることができず、私はどこが間違っているのかわかりません。詳細については下記のコードをご覧ください。何か助けていただければ幸いです。ありがとうございます。Aフレーム(webvr)のcolladaオブジェクトを使用するイベントセットコンポーネント

<html> 
<head> 
<title>Model Test</title> 
<script src="build.js"></script> 
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script> 
<script src="aframe-animation-component.min.js"></script> 
<script src="component/event-proxy.js"></script> 
<script src="https://unpkg.com/[email protected]/dist/aframe-event-set-component.min.js"></script> 
<script src="https://unpkg.com/[email protected]/dist/aframe-layout-component.min.js"></script> 
</head> 
<body> 
<a-scene> 
    <a-entity id="container" position="0 0 -2"> 
    <a-collada-model src="iPhone4.dae" 
     animation__rotationX="property: rotation; dur: 10000; 
         easing: easeInSine; loop: true; to: 0 360 0; 
         startEvents: rotY; pauseEvents: animationPause; 
         resumeEvents: animationResume; restartEvents: animationRestart" 
     animation__rotationY="property: rotation; dur: 10000; 
         easing: easeInSine; loop: true; to: 360 0 0; 
         startEvents: rotX; pauseEvents: animationPause; 
         resumeEvents: animationResume; restartEvents: animationRestart" 

     position="0 1 -2"> 
    </a-collada-model> 
    <a-mixin id="option" 
      geometry="primitive: sphere; radius: .25;" 
      material="color: red" 
      event-proxy="listen: click; target: a-collada-model" 
      ></a-mixin> 
    <a-entity position="-2.5 0 0"> 
     <a-entity mixin="option" event-proxy="emit: rotY" text="value: Rotation"></a-entity> 
    </a-entity> 
    <a-entity position="2.5 0 0"> 
     <a-entity mixin="option" event-proxy="emit: rotX" text="value: Rotation"></a-entity> 
    </a-entity> 

    <a-entity position="0 -1.5 0"> 
     <a-sphere mixin="option" event-proxy="emit: animationPause" text="value: Pause"></a-entity> 
    </a-entity> 
    </a-entity> 


    <!-- Sky. --> 
    <a-sky color="#0fbbff"></a-sky> 

    <a-entity position="0 0 3"> 
    <a-camera><a-cursor color="#FFF"></a-cursor></a-camera> 
    </a-entity> 
</a-scene> 

</body> 
</html> 

答えて

0

まず、0.6.0にアップグレードしてください。私はイベントやアニメーションのコンポーネントについてはどうか分かりませんが、アフリカではモデル処理が0.6.0より優れています。その後
docsのように、代わりに原始的で、コンポーネントとしてCOLLADAローダーを使用しよう:

<a-entity collada-model="src:iphone4.dae"></a-entity> 

あなたはモデルが表示されるように作ることができない場合は、あなたがにフォーマットを切り替えたいかもしれませんあなたのiPhoneをclara.ioにアップロードするか、またはkhronos/kupoman輸出者を使用し、Don McCurdyのloadersを使用して、3js json、または.glTFをダウンロードしてください。


Btwイベントには問題はないようですが、モデルでは、トピックがちょっとずれています:p

関連する問題