如何将DirectX从C ++转换为C#

编程入门 行业动态 更新时间:2024-10-13 22:19:21
本文介绍了如何将DirectX从C ++转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

对不起,我意识到我的问题是如何从C ++迁移到C#. 因为我刚刚在C ++中找到了Directx的说明 我在使用D3DXMATRIXA16和D3DXVECTOR3,DWORD时遇到问题. 谁可以帮助我转换? 我在这里发布代码: //矩阵函数

Sorry,I realize my problem is how to move from C++ to C#. Because I just found instructions Directx with C++ I have problems with D3DXMATRIXA16 and D3DXVECTOR3,DWORD. Who can help me convert? I post my code here: // Matrices function

void CalcMatrices(void) { D3DXMATRIXA16 ViewMatrix; // set the view matrix D3DXVECTOR3 EyePoint(g_Camera.Location.x, g_Camera.Location.y, g_Camera.Location.z); D3DXVECTOR3 LookAt(g_Camera.Location.x+cos(g_Camera.Rotation), g_Camera.Location.y, g_Camera.Location.z+sin(g_Camera.Rotation)); D3DXVECTOR3 UpVector(0.0f, 1.0f, 0.0f); D3DXMatrixLookAtLH(&ViewMatrix, &EyePoint, &LookAt, &UpVector); g_pDirect3D_Device->SetTransform(D3DTS_VIEW, &ViewMatrix); }

以及此处的链接: [视图] 谢谢

And a link here:[view] Thanks

推荐答案

大写的东西可能是#define.因此,在源代码中进行查找,您将看到需要转换的实际代码.访问诸如Location之类的属性将完全相同,对象将在C#中具有相同的属性. The stuff that''s all in caps, is probably a #define. So, look it up in the source and you''ll see the actual code you need to convert. Accessing properties like Location, would just work exactly the same, the objects will have the same properties in C#.

更多推荐

如何将DirectX从C ++转换为C#

本文发布于:2023-11-07 23:37:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567740.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   如何将   DirectX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!