English 中文(简体)
C++ 矢量多重复
原标题:C++ matrix-vector multiplication

在与三版图合作时,取样扫描器USUALLY利用以下操作进行病媒状况转变:

result = mul(matrix, vector);

这显然意味着:

result = mul(vector, matrix_transposed);

Also, 仅提及,大多数线性图书馆更倾向于只离开<条码>查询器*简化手续的复制操作<>。


<><>Now>:>,请让我说一下,我要将<代码>vector>(例如,位置),使用某些具体矩阵表(具体来说,请上> 矩阵操作>。 因此,我设计了简单的world-view-projection矩阵,然后将其传送给我的斜体。

  D3DXMatrixRotationX(&world, 0.05f);

  D3DXMatrixLookAtLH(&view, &D3DXVECTOR3(400.0f, 80.0f, 0.0f),
                            &D3DXVECTOR3(0.1f, 0.1f, 0.0f),
                            &D3DXVECTOR3(0.0f, 1.0f, 0.0f));

  D3DXMatrixPerspectiveFovLH(&projection, 0.5f, 800.0f / 600.0f, 1.0f, 1500.0f);

  D3DXMATRIX wvp = world * view * projection;

  Set Shader Parameter (wvp); // Pseudocode here

Question:


在这里,我可以理解——如果这样做的话,那么,斜体代码应为

result = mul(vector, wvp)

用于这一转变至工作(从矩阵的左侧乘)。

为什么发生这种情况? sample shaders>/em>有result = mul(wvp, 矢量)的转变(以及don t transpose)。 在将其定为参数之前的矩阵?

www.un.org/Depts/DGACM/index_spanish.htm 我在哪里错了?

www.un.org/Depts/DGACM/index_french.htm


略微增加信息——矩阵>row-major的校正,我使用相应的功能,即row-major矩阵作为参数(cgSetMatrixParafr)。

<>m>Of course,我可以“传递”这一矩阵,称其功能cgSetMatrixPara amountfc,该功能将输入数据作为单体矩阵(和“自动”transposes)处理,但那将是rid。

最佳回答

数学公约(因此在方案拟定中)是,你通过从右边转变使病媒倍增:matrix * 矢量=转化病媒<>。 因此,我不理解你的申诉。 该矩阵已经设定为正确的矩阵。 如果您想将病媒从左侧then中成倍,则您需要转换成矩阵:result = mul(r, transpose(wvp)

http://www.un.org。 OK, Direct3D 实际上是相反的。 它使左侧的病媒成倍增加(将其用作行而不是一栏)。 例如,开放式自由工与普通人一样享有这一权利。 因此,你需要将变式矩阵装入 c方案。

问题回答

如果两个矩阵都属于神学、广场和面积相同,那么多功能是相互参照的。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?