首页 > Web开发 > 详细

WebGL_0014:改变相机的刷新颜色

时间:2020-08-14 02:12:35      阅读:56      评论:0      收藏:0      [点我收藏+]

1,

CameraColorShift.prototype.OnColorShift = function(a) {
    switch (a) {
    case 0:
        targetColor = this.colorTable_1;
        break;
    case 1:
        targetColor = this.colorTable_2;
        break;
    case 2:
        targetColor = this.colorTable_3;
        break;
    case 3:
        targetColor = this.colorTable_4;
        break;
    case 4:
        targetColor = this.colorTable_5;
        break;
    default:
        targetColor = this.colorTable_1
    }
    this.lerpTimer = 0
};
CameraColorShift.prototype.LerpMatColorTo = function(a, b) {
    return a.r += (b.r - a.r) * this.colorLerpSpeed, a.g += (b.g - a.g) * this.colorLerpSpeed, a.b += (b.b - a.b) * this.colorLerpSpeed, a
};
CameraColorShift.prototype.update = function(a) {
    if (this.lerpTimer < this.lerpTimeTotal) {
        var b;
        b = this.entity.camera.clearColor;
        b = new pc.Color(b.r, b.g, b.b);
        b = this.LerpMatColorTo(b, targetColor);
        this.entity.camera.clearColor = new pc.Color(b.r, b.g, b.b);
        this.lerpTimer += a
    }
};
CameraColorShift.prototype.swap = function(a) {};

 

技术分享图片

 

WebGL_0014:改变相机的刷新颜色

原文:https://www.cnblogs.com/eliteboy/p/13499097.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!