我试图通过这样做来为A-Frame中的雾色设置动画:
<a-scene antialias="true" fog="type: exponential; color: #444; density: 0.1">
<a-animation attribute="fog.color" from="#444" to="#000" dur="2000"></a-animation>
</a-scene>
但它似乎不起作用。我可以通过这种方式设置密度效果,但颜色只是瞬间变化。
答案 0 :(得分:1)
可能是一个错误。也许尝试动画组件。 https://github.com/ngokevin/kframe/tree/master/components/animation/
<head>
<title>My A-Frame Scene</title>
<script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script>
</head>
<body>
<a-scene fog="color: #444" animation__fog="property: fog.color; to: #000; dur: 2000">
</a-scene>
</body>