1
我想在A-frame的事件集組件插件上使用事件集組件插件創建一個collada對象上的旋轉動畫,我已經成功地使用-box,但想要動畫化collada對象。出於某種原因,我無法看到collada對象,也不知道我要出錯的地方。請參閱下面的代碼獲取更多信息,任何幫助將不勝感激,謝謝。在A-Frame中使用collada對象的事件集組件(webvr)
<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>