three.js入门系列之光源

首先创建场景来试验各种光源带来的不同效果:

image.png

image.png

一、锥形光源(聚光灯)

SpotLight

image.png

image.png

接下来缩小范围(π/7):

image.png

二、基础光源(环境光)

AmbientLight

上例中没有添加环境光,使得周围黑漆漆的,下面就添加环境光:

image.png

效果:

image.png

三、点光源(照射所有方向)

PointLight

image.png

为了更加明确地展示此光源的效果,特地将正方体位置坐了改变:

image.png

四、平行光(太阳光)

DirectionalLight

image.pngimage.png

五、待续


猜你喜欢

转载自www.cnblogs.com/eco-just/p/10127280.html