2016-09-28 55 views
0

我試圖做這個動畫在A型架霧的顏色:動畫化幀霧的顏色

<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

可能是一個錯誤。也許嘗試動畫組件。 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> 
+0

非常感謝@ngokevin這樣做的伎倆 – DFSOKO