Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sorry,I realize my problem is how to move from C++ to C#.
Because I just found instructions Directx with C++.net
I have problems with D3DXMATRIXA16 and D3DXVECTOR3,DWORD.
Who can help me convert?
I post my code here:
// Matrices function
C#
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
Posted

1 solution

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#.
 
Share this answer
 
Comments
giatuan2011 14-Aug-11 6:07am    
Thanks,your answer. I have access to Microsoft.DirectX and Microsoft.DirectX.Direct3D.C# has Matrix,not D3DXMATRIXA16,D3DXVECTOR3.I suspect my C# version too old.Google has some D3D code C++6.After converting C + +8. I got a lot of errors.I can not use other versions because my college uses 2005.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900