Re: [DirectPython] Matrix functions
Status: Inactive
Brought to you by:
hsalo
From: Heikki S. <ho...@gm...> - 2007-02-26 11:31:17
|
_____ From: dir...@li... [mailto:dir...@li...] On Behalf Of M. Utku Altinkaya Sent: 26. helmikuuta 2007 6:22 To: dir...@li... Subject: [DirectPython] Matrix functions Hi, Is there any way I can use D3DXMatrixTranslation, D3DXMatrixRotation etc. Also I was not able to find a Matrix class like d3dx.Vector, am I missing something or are these not implemented. It is possible to use all those functions if you have ctypes installed (Python 2.5 has it by default). You can use d3dx._d3dx9dll to determine which dll you should use. There are several tutorials for ctypes and "DirectX for comtypes" (see the SourceForge downloads) has few examples, too. Check the directx.util and Frame.SetTransform() for a simple example. D3DXMATRIX and other structs and functions are not currently exported because ctypes is not always available and people often use other structs instead (like NumPy matrices, arrays or raw memory). Basically D3DX matrix is just a block of memory containing 16 floats so if you "know" the alignment requirements and byte representation of a structure, you can pass other things to functions which excpect a D3DXMATRIX (altough this is little dangerous and not generally recommended). -- Heikki Salo |