我一直试图使用Tweenmax为threejs中的天幕颜色设置动画,但我的所有尝试都失败了。
有没有人知道如何做到这一点?非常感谢。
//////// SKYBOX////////
var vertexShader = document.getElementById('sky-vertex').textContent, fragmentShader = document.getElementById('sky-fragment').textContent;
var uniforms = {
topColor: {type: "c", value: new THREE.Color(blue)}, //autour
bottomColor: {type: "c", value: new THREE.Color(blue)}, //milieu
offset: {type: "f", value: 30},
exponent: {type: "f", value: 0.18}
};
var elem = document.getElementById('sky-fragment')
var blueFirst = new THREE.Color( 0x08088A ).getHex();
var blueSecond = new THREE.Color( 0x81F7F3 ).getHex();
var blue = TweenMax.fromTo(elem,0.5,{color: blueFirst},{color: blueSecond});
var skyBox = new THREE.Mesh( skyGeometry, skyMaterial );
scene.add( skyBox );