游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2013|回复: 7

在矩阵变换的时候一般是怎么优化的?

[复制链接]

8

主题

46

帖子

52

积分

注册会员

Rank: 2

积分
52
发表于 2007-1-18 02:45:00 | 显示全部楼层 |阅读模式
一般来说都是设置三个矩阵然后 SetTransform.....

Direct3D uses the world and view matrices that you set to configure several internal data structures. Each time you set a new world or view matrix, the system recalculates the associated internal structures. Setting these matrices frequently-for example, thousands of times per frame-is computationally time-consuming. You can minimize the number of required calculations by concatenating your world and view matrices into a world-view matrix that you set as the world matrix, and then setting the view matrix to the identity. Keep cached copies of individual world and view matrices so that you can modify, concatenate, and reset the world matrix as needed. For clarity, in this documentation Direct3D samples rarely employ this optimization.


上面具体来说是什么意思?? 优点懂可是有又点不懂......

35

主题

1735

帖子

1739

积分

金牌会员

Rank: 6Rank: 6

积分
1739
QQ
发表于 2007-1-18 17:40:00 | 显示全部楼层

Re:在矩阵变换的时候一般是怎么优化的?

全是E文,我是完全的不懂。

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2007-1-18 18:57:00 | 显示全部楼层

Re:在矩阵变换的时候一般是怎么优化的?

它是说把世界变换矩阵和观察变换矩阵何到一起,就像OpenGL那样。

8

主题

46

帖子

52

积分

注册会员

Rank: 2

积分
52
 楼主| 发表于 2007-1-18 19:50:00 | 显示全部楼层

Re:在矩阵变换的时候一般是怎么优化的?

谢谢ls两位
xgreenclover

大概意思我懂,可是具体是怎么来做呢?? 如何合并为一个矩阵?

35

主题

1735

帖子

1739

积分

金牌会员

Rank: 6Rank: 6

积分
1739
QQ
发表于 2007-1-18 21:22:00 | 显示全部楼层

Re:在矩阵变换的时候一般是怎么优化的?

乘呗。

2

主题

429

帖子

435

积分

中级会员

Rank: 3Rank: 3

积分
435
发表于 2007-1-19 01:51:00 | 显示全部楼层

Re: Re:在矩阵变换的时候一般是怎么优化的?

xgreenclover: Re:在矩阵变换的时候一般是怎么优化的?

它是说把世界变换矩阵和观察变换矩阵何到一起,就像OpenGL那样。

乘呗。



好像不单是指乘吧。。。本来就要乘的啊,这里乘怎么体现优化?

59

主题

1104

帖子

1199

积分

金牌会员

Rank: 6Rank: 6

积分
1199
发表于 2007-1-19 13:55:00 | 显示全部楼层

Re:在矩阵变换的时候一般是怎么优化的?

优化的话可以在矩阵结构里加一个标志位,加一些标志,比如ROTATION_ZERO, TRANSLATION_ZERO,  之类的, 对于这些标志位在做运算时做特殊处理, 能省不少时间.

8

主题

46

帖子

52

积分

注册会员

Rank: 2

积分
52
 楼主| 发表于 2007-1-21 16:51:00 | 显示全部楼层

Re:在矩阵变换的时候一般是怎么优化的?

还有别的优化方式么?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-26 06:56

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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