定义光坐标

发布于 2024-08-24 09:37:48 字数 526 浏览 7 评论 0原文

几天前我参加了计算机图形学考试,其中有如下额外的学分问题:

灯光可以通过两种方式之一定义。它可以在世界坐标中定义,例如路灯,或在观察者(眼睛坐标)中定义,例如矿工佩戴的头灯。无论哪种情况,观点都可以自由改变。描述在这两种情况下光线应如何进行不同的转换。

由于我要到春假后才能看到结果,所以我想我会在这里问。

似乎所使用的类比具有误导性 - 您不能像在眼睛坐标中一样定义位于世界坐标中观看者眼睛处的光源吗?我一直在研究 OpenGL 如何处理光线,似乎它总是使用眼睛坐标 - ModelView 矩阵将应用于世界坐标中的任何光线。

在这种情况下,答案可能就是您必须使用 ModelView 矩阵之类的东西将世界坐标中定义的光转换为眼睛坐标,而眼睛坐标中定义的光只需要通过投影矩阵进行转换。

话又说回来,我可能完全在思考(或过度思考)。

我的另一个想法是,它决定渲染阴影的方式,但这更多地与灯光的位置及其类型(点、方向、发射等)有关,而不是它所表示的坐标。

有什么想法吗?

I took a Computer Graphics exam a couple of days ago which had extra credit question like the following:

A light can be defined in one of two ways. It can be defined in world coordinates, e.g. a street light, or in the viewer (eye coordinates), e.g., a head-lamp worn by a miner. In either case the viewpoint can freely change. Describe how the light should be transformed different in these two cases.

Since I won't get to see the results of this until after spring break, I thought I would ask here.

It seems like the analogies being used are misleading - could you not define a light source that is located at the viewers eye in world coordinates just as well as you could in eye coordinates? I've been doing some research on how OpenGL handles light, and it seems as though it always uses eye coordinates - the ModelView matrix would be applied to any light in world coordinates.

In that case the answer may just be that you would have to transform light defined in world coordinates into eye coordinates using something like the ModelView matrix, while light defined in eye coordinates would only need to be transformed by the projection matrix.

Then again I could be totally under thinking (or over thinking this).

Another thought I had is that it determines which way you render shadows, but that has more to do with the location of the light and its type (point, directional, emission, etc) than what coordinates it is represented in.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谜兔 2024-08-31 09:37:48

灯光的位置由定义灯光时处于活动状态的模型视图矩阵进行转换。。

如果模型视图矩阵在该点是恒等的,您将获得眼睛坐标中的光线。

如果模型视图矩阵是相机矩阵的逆矩阵,您将获得世界空间中的光线。

The light's position is transformed by the modelview matrix that was active at the moment the light was defined.

If the modelview matrix was identity at that point, you'll get the light in eye coordinates.

If the modelview matrix was the inverse of your camera matrix, you'll get the light in world space.

不回头走下去 2024-08-31 09:37:48

对于路灯来说,当视点移动时,世界坐标将保持不变。

对于头灯,当视点移动时,眼睛坐标将保持不变。

In the case of the street light, the world coordinates will stay constant when the viewpoint moves.

In the case of the head-lamp, the eye coordinates will stay constant when the viewpoint moves.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文