2017-04-15 51 views
4

我想漸變顏色添加到球體,目前我設置的顏色:添加漸變色,以非球面

<a-sphere position="1 1 0" color="#ef2d5e"> 
      <a-animation attribute="rotation" to="0 360 0" dur="10000" easing="linear" repeat="indefinite"> 
</a-animation> 
</a-sphere> 

Demo

如何添加漸變到球?有什麼辦法嗎?

回答

3

嘗試https://github.com/zcanter/aframe-gradient-sky

<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script> 

<script src="https://rawgit.com/zcanter/aframe-gradient-sky/master/dist/gradientsky.min.js"></script> 

<a-scene> 

     <!-- A Sphere --> 
     <a-entity geometry="primitive: sphere" material="shader: gradient; topColor: 255 100 100; bottomColor: 100 100 200; offset: 0.0001" position="0 0 -5"></a-entity> 

    </a-scene> 
+0

謝謝您的回答,我該怎麼做同樣只用球不是整個場景? – bhansa

+0

'' – ngokevin

+0

無法解決它,你能更新我的小提琴並粘貼在這裏。我試過但沒有工作。 – bhansa