游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2305|回复: 6

perspective变换的不解

[复制链接]

8

主题

390

帖子

390

积分

中级会员

Rank: 3Rank: 3

积分
390
发表于 2007-6-15 10:07:00 | 显示全部楼层 |阅读模式
dx sdk文档有段话
The perspective transform converts a viewing frustum into a new coordinate
space. Notice that the frustum becomes cuboid and also that the origin moves
from the upper-right corner of the scene to the center.
//
大概意思是:投影变换将视锥变换到一个新的坐标系下,值得提醒的是上述视锥变成了立方体形状,而且上述视锥的原点从右上角移到到中心。
//
最奇怪的是“ upper-right corner”,view space下也不是在右上角啊,哪位大侠了解?是否哪里我理解错了,谢谢。

8

主题

390

帖子

390

积分

中级会员

Rank: 3Rank: 3

积分
390
 楼主| 发表于 2007-6-15 10:12:00 | 显示全部楼层

Re:perspective变换的不解

http://msdn2.microsoft.com/en-us/library/bb147302.aspx
看这,有个图,说原点从右上移到了中心,不理解,原点啥时候跑右上去了。

0

主题

5

帖子

59

积分

注册会员

Rank: 2

积分
59
发表于 2007-6-15 15:56:00 | 显示全部楼层

Re:perspective变换的不解

微软的人经常喜欢开玩笑

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
发表于 2007-6-16 12:28:00 | 显示全部楼层

Re:perspective变换的不解

不难理解啊,视锥在投影变换之后是一个紧贴Y平面z深度为1的立方体。投影变换之前是一个锥体。
upper-right corner是用来确定锥体是怎么摆放的,正着,睡着,还是倒过来放完全决定于自身的upper-right corner

23

主题

63

帖子

68

积分

注册会员

Rank: 2

积分
68
发表于 2007-6-16 18:39:00 | 显示全部楼层

Re:perspective变换的不解

不懂。首先,从右上角移动到中心的是"Origin",我一直认为只有坐标系才有原点。就算右上角点可以确定锥体怎么摆放,楼上的仁兄请再解释一下,它为什么就是原点了呢,又是哪个坐标系的原点?

我到GameDev上问了一下这个问题,有人回复:
This seems like an error in the documentation. The scene does get shifted from -1...1 to 0...viewport height and width, but this happens automatically after the perspective transform (fixed function vertex pipeline) or vertex shader (programmable vertex pipeline), and before pixel shader or combiner.

An ordinary perspective transform doesn't usually specify translations in xy plane. An exception to this is if you actually want to shift the perspective center around.
(回复者是Programming Vertex, Geometry and Pixel Shaders with Direct3D 10一书的作者Niko Suni)

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
发表于 2007-6-17 08:08:00 | 显示全部楼层

Re:perspective变换的不解

后面the origin moves from the upper-right corner of the scene to the center.是说的有点问题,应该是贴着y平面的立方体的面的中心,我的理解是upper-right 决定立方体的摆放有没有旋转的成分,也许是文档没有表达清楚

7

主题

57

帖子

57

积分

注册会员

Rank: 2

积分
57
发表于 2007-6-22 10:51:00 | 显示全部楼层

Re:perspective变换的不解

别管SDK了,就按图形学的理论理解!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-26 02:02

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表