游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1424|回复: 2

rendermonkey中的矩阵乘法

[复制链接]

42

主题

140

帖子

158

积分

注册会员

Rank: 2

积分
158
发表于 2009-3-26 21:56:00 | 显示全部楼层 |阅读模式
float4x4 matViewProj;
float4x4 matView;
float4x4 matProj;

void main(float4 inPos : POSITION,
          out float4 outPos : POSITION)
{
   float4 pos = mul(inPos, matView);
   outPos = mul(matProj, pos);

}
用的hlsl为什么outPos = mul(matProj, pos);而不是outPos = mul(pos, matProj);

11

主题

650

帖子

651

积分

高级会员

Rank: 4

积分
651
发表于 2009-3-26 22:21:00 | 显示全部楼层

Re: rendermonkey中的矩阵乘法


参考  qrli大人的博客http://blog.csdn.net/Nightmare/archive/2009/03/12/3983724.aspx

另rendermonkey可以设置 行向量或列向量

5

主题

755

帖子

757

积分

高级会员

Rank: 4

积分
757
发表于 2009-3-27 18:11:00 | 显示全部楼层

Re:rendermonkey中的矩阵乘法

左乘右乘结果不意义不一样的。看下书
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-12-20 17:24

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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