当前位置:网站首页>[C] give the earth some light
[C] give the earth some light
2022-04-21 13:15:00 【Micro cold】
Antecedents feed
- WPF 3D preliminary
- Use the keyboard to control the camera angle of view
- Use the mouse to control the camera angle of view
- Make a for your second dimensional wives 3D Gallery
- use C# Rub an earth
Despite the creation of an earth , But I always feel something wrong , The key is that the light is given too evenly , From east to West , All parts of the earth have the same brightness , It's obviously unreasonable .
The reason for this problem , Because the light effect we have been using is AmbientLight, The characteristic of this lighting effect is to uniformly illuminate all objects . To make the Earth spin more real , Maybe a point light source is better , After all, the sun is a point .
Results after using point light , The effect is as follows

The code is easy to modify , That is, when the coordinate is ( 5 , − 2 , 5 ) (5,-2,5) (5,−2,5) An all white light source is placed in the position of .
private void DefineLights(Model3DGroup group)
{
var ptLight = new PointLight(Color.FromRgb(255,255,255), new Point3D(5, -2, 5));
group.Children.Add(ptLight);
}
Of course , The sun is very far from the earth , To make the effect look more realistic , Or pull the point light further , For example, put it on ( 50 , − 3 , 50 ) (50,-3,50) (50,−3,50) The location of ; Or don't point the light at all , Direct the last line light source . The effects of both are as follows
![]() |
![]() |
among , The definition method of linear light source is , among Vector3D Represents the direction of light .
private void DefineLights(Model3DGroup group)
{
var white = Color.FromRgb(255, 255, 255);
var dirLight = new DirectionalLight(white, new Vector3D(-50, 4, -50));
group.Children.Add(dirLight);
}
Although line lights look more realistic , But it's not cool , If you call, the stage seems better .SpotLight Conical light effect , The effect is

The code is
private void DefineLights(Model3DGroup group)
{
var white = Color.FromRgb(255, 255, 255);
var spLight = new SpotLight(white, new Point3D(10, 10, 10),
new Vector3D(-10, -10, -10), 10, 5);
group.Children.Add(spLight);
}
among ,SpotLight On initialization , The input variables represent the position of the light source 、 Irradiation direction 、 Outer divergence angle and inner divergence angle .
版权声明
本文为[Micro cold]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211313341903.html
边栏推荐
- 农产品期货品种有哪些呢?
- 2021-08-10
- Build a service registration and Discovery Center
- Revit二次开发之创建插件面板(第十五期)
- 程序员学习遇到的问题
- OJ daily practice - piecewise function
- 网易数帆王佰平:我的 Envoy Maintainer 之路
- S TYLE N E RF: A S TYLE - BASED 3D-A WARE G ENERA - TOR FOR H IGH - RESOLUTION I MAGE S YNTHESIS
- [digital signal processing] correlation coefficient (concept analysis of correlation coefficient | signal energy constant | conjugate sequence | correlation of sequence at the same time)
- C language nesting exercise
猜你喜欢

【数字信号处理】线性常系数差分方程 ( 使用 matlab 求解 “ 线性常系数差分方程 “ 示例 | A 向量分析 | B 向量分析 | 输入序列分析 | matlab 代码 )

Qfileinfo file and folder operations

Can great talents be of little use? Oceanbase integration scenario test

【uvm】 多模块env结构
![[source code analysis] encoding in style: a stylegan encoder for image to image translation](/img/2a/4d219785548b063d8ef5b736cdbb5f.png)
[source code analysis] encoding in style: a stylegan encoder for image to image translation

leetcode:无数个面额的硬币得到amount的选法(dp)

【csnote】db异常(冗余数据、修改异常、删除异常、插入异常)

【源码解析】Encoding in Style: a StyleGAN Encoder for Image-to-Image Translation

月销超千万,新防晒时代「蕉下」如何成为爆款制造机?

美创科技受邀为海淀区教育科学研究院开展数据安全培训
随机推荐
版图设计的技巧
Creating plug-in panel for Revit secondary development (issue 15)
OJ每日一练——数组倒序输出新数组
(recommended intensive reading) this refers to the north
滑動窗口系列-尋找最小覆蓋字串
MySQL使用安装pip和binlog2sql
[digital signal processing] correlation function (energy signal | cross correlation function of energy signal | autocorrelation function of energy signal)
The packaged jar can run normally and connect to the database normally. Exe4j generates exe and reports an error when accessing the database:
Sliding window series - find minimum overlay string
C language nesting exercise
Underlying principle of high concurrent IO
OJ每日一练——分段函数
从Revit中选取元素(第五期)
Algorithem_ Populating Next Right Pointers in Each Node
完成数亿元融资后,毫末智行计划超百城落地城市智能驾驶产品
Skills of layout design
Revit二次开发——创建标高(第八期)
2021-08-10
一文读懂Faster RCNN
[digital signal processing] correlation coefficient (concept analysis of correlation coefficient | signal energy constant | conjugate sequence | correlation of sequence at the same time)

