什么是OpenGL中的正常? [英] What is a normal in OpenGL?

查看:163
本文介绍了什么是OpenGL中的正常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说我应该使用法线代替颜色,因为颜色已被弃用。 (这是真的吗?)法线与光的反射有关,但我找不到一个清晰和直观的解释。什么是正常的?

I heard that I should use normals instead of colors, because colors are deprecated. (Is that true?) Normals have something to do with the reflection of light, but I can't find a clear and intuitive explanation. What is a normal?

推荐答案

A 法线通常是其方向垂直于特定点处的表面的单位矢量。因此,它告诉你表面面向哪个方向。法线的主要用例是照明计算,其中必须确定给定表面点处的法线与朝向光源或相机的方向之间的角度(或实际上常常是其余弦)。

A normal in general is a unit vector whose direction is perpendicular to a surface at a specific point. Therefore it tells you in which direction a surface is facing. The main use case for normals are lighting calculations, where you have to determine the angle (or practically often its cosine) between the normal at a given surface point and the direction towards a lightsource or a camera.

这篇关于什么是OpenGL中的正常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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