Three.js 阴影无法正常工作 [英] Three.js shadows not working properly

查看:86
本文介绍了Three.js 阴影无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解 Three.js 中的阴影,我在 jsfiddle 中找到了这个很好的例子.但是我不明白为什么,当我将光的 y 降低到 65 时,即:

I was trying to learn about shadows in Three.js and I found this nice example in jsfiddle. However I am not able to understand why, when I lower the y of light to like 65, that is:

light.position.set( 20, 65, 0 );

阴影完全消失.同时,70 以上的一切都很好,并且阴影被投射了.像往常一样,我可能遗漏了一些明显的东西,但我真的看不出是什么阻止了光线形成阴影.

the shadow disappears completely. Meanwhile, everything above 70 is perfectly fine and the shadow is cast. Like always, I am probably missing something obvious, but I really cannot see what can be preventing the light from making that shadow.

推荐答案

你可以试试:

light.shadowCameraVisible = true;

要查看屏幕上灯光的位置和方向,这将有助于您了解正在发生的变化.

To see the position and direction of the light on screen this will help you to understand what is changing.

希望有帮助:)

这篇关于Three.js 阴影无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆