在React Three Fiber中如何创建一个作为光源的对象?

huangapple go评论126阅读模式
英文:

How do we create an Object as source of light in React Three Fiber?

问题

使用定向/点光会生成来自对象外部而不是内部的光。

示例:太阳应该是周围物体的光源。
请查看以下图像以了解问题陈述:

定向光示例
点光示例

我试图在React-Three-Fiber中将太阳对象作为光源。

英文:

Using directional/ point light will generate light from outside but not from inside the Object.

Example: Sun should be the source of light to the Objects around.
Please find the images below to understand the problem statement

Directional Light Example
Point Light Example

I'm trying to make the Sun object as the source of light in React-Three-Fiber

答案1

得分: 2

如果您使太阳网格不与阴影交互,PointLight 将穿透它的光照,即使放置在中心位置。

sun.castShadow = false;
sun.receiveShadow = false;
英文:

If you make the sun mesh not interact with shadows, the PointLight will illuminate right through it, even when placed in the center.

sun.castShadow = false;
sun.receiveShadow = false;

huangapple
  • 本文由 发表于 2023年2月14日 21:27:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75448519.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定