一个用python调用DirectX的类库

项目地址:http://dxpython.pythonworld.net/

运行条件:

  • DirectX 9.0c
  • Python 2.4.1
  • Windows XP (I've tested only on Windows XP, but pretty sure that it will work on Windows2000 series too)

1. Sample Code

   1 >>> from dx.d3d9 import *
   2 >>> u = D3DXVECTOR3(1.0, -1.0, 0.0)
   3 >>> v = D3DXVECTOR3(3.0, 2.0, 1.0)
   4 >>> D3DXVec3Dot(u, v)       # innter product
   5 1.0
   6 >>> out = D3DXVec3Cross(u, v)  # cross product
   7 >>> print out
   8 <D3DXVECTOR3> <x>-1.0</x> <y>-1.0</y> <z>5.0</z> </D3DXVECTOR3>