Differences between revisions 1 and 2
Revision 1 as of 2005-08-06 04:43:52
Size: 582
Editor: qingfeng
Comment:
Revision 2 as of 2009-12-25 07:12:48
Size: 582
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

一个用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)

Sample Code

Toggle line numbers
   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>

dxPython (last edited 2009-12-25 07:12:48 by localhost)