directpython-general Mailing List for DirectPython (Page 4)
Status: Inactive
Brought to you by:
hsalo
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
(3) |
Jun
(2) |
Jul
(5) |
Aug
(3) |
Sep
|
Oct
(2) |
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(2) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(5) |
Aug
(11) |
Sep
|
Oct
(3) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
(3) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(4) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gert <ge...@el...> - 2006-08-19 20:58:04
|
I am trying to check the possibilities of DirectPython by converting the DirectX tutorials to Python. Can you tell me what's wrong with the following example ? The sprite rotates but the triangle stays in place. I have downloaded the source-code but could not find a way to compile it. Am I missing some makefiles or is there a trick to compile the sources ? Regards, Gert ---- import math import array import d3d import d3dx from d3dc import * use_framework = False vertices = ( ( 150, 50 , 0.5, 1, 0xffffff00 ), ( 250, 250, 0.5, 1, 0xffff00ff ), ( 50, 250, 0.5, 1, 0xff00ff00 ) ) class CreateDevice( d3dx.Frame ): def __init__(self, *args, **kwargs): d3dx.Frame.__init__(self, *args, **kwargs) self.angle = 0 def onCreate( self ): self.vbuffer = d3d.VertexBuffer( FVF.XYZRHW | FVF.DIFFUSE, len( vertices ) ) self.vbuffer.extend( vertices ) def setupMatrices( self ): self.angle += 0.01 matrix = array.array("f", ( math.cos(self.angle), 0.0, -math.sin(self.angle), 0.0, 0.0, 1.0, 0.0, 0.0, math.sin(self.angle), 0.0, math.cos(self.angle), 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0)) d3d.setMatrix(matrix, MATRIX.WORLD) d3d.setView( ( 0.0, 3.0, -5.0 ), ( 0.0, 1.0, 0.0 ), 100, math.pi / 4 ) def onRender( self ): d3d.clear( 0x00000000 ) self.setupMatrices() d3d.setState( RS.FVF, FVF.XYZRHW | FVF.DIFFUSE ) d3d.drawVertices( TYPE.TRIANGLELIST, self.vbuffer ) def mainloop(): #Create a windowed device. This sample does not #support real fullscreen mode, see the other samples #and d3dx.Frame if you want fullscreen. window = ( 200, 200, 800, 600 ) title = u"D3D Tutorial 1: CreateDevice" d3d.createDevice( title, u'', window[2], window[3], False, CREATE.HARDWARE | CREATE.NOVSYNC ) vbuffer = d3d.VertexBuffer( FVF.XYZRHW | FVF.DIFFUSE, len( vertices ) ) vbuffer.extend( vertices ) texture = d3d.Texture("textures/tree.dds") d3d.setWindow( *window ) angle = 0 while True: #Handle messages. This very basic sample #only checks for QUIT or escape key being pressed for m in d3d.getMessages(): if m[0] == WM.QUIT: return if m[0] == WM.KEY: if m[1] == 27: # 'Escape key' return #Clear the buffer and begin the scene. d3d.clear( 0x00ff0000 ) # 0xAARRGGBB d3d.beginScene() matrix = array.array("f", ( math.cos(angle), math.sin(angle), 0.0, 0.0, -math.sin(angle), math.cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, )) angle += 0.01 d3d.setState( RS.FVF, FVF.XYZRHW | FVF.DIFFUSE ) d3d.setMatrix(matrix, MATRIX.WORLD) d3d.drawVertices( TYPE.TRIANGLELIST, vbuffer ) d3d.setMatrix(matrix, MATRIX.SPRITE) d3d.drawSprites(texture, [(-50, -50, 0.5, -1, -1, -1, -1, 0x80ffffff)]) #End the scene and present the drawing. d3d.endScene() d3d.present() if __name__ == "__main__": if use_framework: frm = CreateDevice( u'D3D Tutorial 2: Vertices' ) frm.mainloop() else: mainloop() |
From: Heikki S. <ho...@gm...> - 2006-08-01 12:53:34
|
I just uploaded a new version and it should now be available in the SourceForge (with release notes, too). If you have any questions, suggestions or bug reports, feel free to report or post them. -- Heikki Salo |
From: Heikki S. <ho...@gm...> - 2006-07-20 16:55:33
|
After some quiet time, a new version is almost ready for release. There are not many changes or additions, but nothing should break either (well, except for d3dx.GameController and Mouse, but it will be explained in the readme). Some bugs were fixed too. The most significant new feature is a (very) basic GUI library. It's no match for wxPython and the like, but it should be pretty easy to use and works in fullscreen mode. Screenshot: http://directpython.sourceforge.net/screenshots/gui.jpg Misc: If the ctypes-library makes it's experimental COM-support more stable, you can expect some very interesting news. But don't hold your breath as it is mostly up to the ctypes folks to work it out, though I will keep an eye out for any improvements. Any suggestions for features or fixes are still accepted (as always) and if you are fast they might still make into the new release. The first release will be for Python 2.4 but the 2.5 build should be availabe later. -- Heikki Salo |
From: Heikki S. <ho...@gm...> - 2006-07-11 20:38:10
|
=20 > -----Original Message----- > From: dir...@li...=20 > [mailto:dir...@li...]=20 > On Behalf Of Jeffrey Barish > Sent: 11. hein=E4kuuta 2006 20:39 > To: dir...@li... > Subject: Re: [DirectPython] Examples >=20 > On Tuesday 11 July 2006 08:45, Heikki Salo wrote: > > There are currently only two samples that use sounds:=20 > > sampleShipEffects.py uses the d3d.Sound (with 3D effect in newer=20 > > versions) and samplewx.py uses the d3d.Media. The objects=20 > are pretty=20 > > simple to use, so there really is not that much to show. > > > > The Media-object (uses DirectShow) can play pretty much anything if=20 > > corrent codecs (or filters) are registered. Sound (uses=20 > DirectSound)=20 > > can only play .wav files. Googling for "directshow filter/codec=20 > > <wanted format>" will probably find quite a few of them. The codecs=20 > > are usually .exe-files that will register themself when installed.=20 > > After this the Media should be able to play the formats=20 > that the codec supports. > > > > There are some bad codecs out there, so if possible try to get some=20 > > information about them. Also note that .mp3 (and some other formats=20 > > too) is supported directly by the DirectShow so there is usually no=20 > > need to install any codecs in order to play them. > > > > -- > > Heikki Salo > Thank you for your quick response. >=20 > I found sampleShipEffects.py. Emulating the code therein for=20 > playing a sound, I tried: >=20 > >>> import d3d > >>> snd =3D d3d.Sound(u'c:/windows/media/tada.wav', True) > Traceback (most recent call last): > File "<pyshell#1>", line 1, in ? > snd =3D d3d.Sound(u'c:/windows/media/tada.wav', True) > Error: An invalid parameter was passed to the returning function >=20 Sound needs an active focus window. d3d.showWindow(SHOW.SHOW) or d3d.createDevice() will create one. And you can remove the second = argument if you are not playing 3D sounds, it might help.=20 Media can play sounds (.wav is ok) without a visible window, so call d3d.showWindow(SHOW.HIDE) before creating the Media-object and you = should be able to play them. This is probably the better way. > Also, when I try to run sampleShipEffects, it fails with: >=20 > Traceback (most recent call last): > File=20 > "C:\Python24\Lib\site-packages\directpy\samples\sampleShipEffects.py", > line 156, in ? > frame =3D SceneSample2(u"Ship and effects") > File "C:\Python24\lib\site-packages\directpy\d3dx.py", line=20 > 572, in __init__ > fullscreen, CREATE.HARDWARE) > RuntimeError: Failed to create a device >=20 You probably have a pretty old (or maybe some cheap integrated) = card/driver. Try to replace HARDWARE with SOFTWARE. If that fails, try with "SOFTWARE = | NOCAPCHECK" (an old version of DP had a bug in the detection code which might cause this, but it has been already fixed in newer releases). > I found an ogg decoder at Free-Codecs.com (which seems=20 > actually to be from illiminable). I have installed it, so I=20 > hope that once I get past these startup glitches, I will be=20 > able to play an ogg file using DirectPython. >=20 I have played .ogg's with DirectPython, so that should not be a problem. > Also, where do I find documentation for the DirectSound and=20 > DirectShow sound-related objects? Besides playing a sound=20 > file, there are few more functions that I need: I need to be=20 > able to get the current position (time) of playback while a=20 > sound file is playing. I need to be able to specify a=20 > starting time for play. And I need to be able to stop (or=20 > pause) playback. =20 > Are those operations possible with DirectX? >=20 The documentation can be accessed through the shortcut placed somewhere = in your Start-menu (DirectPython -> Documentation). And yes, you should be = able to do those things with d3d.Media. -- Heikki Salo > In case it matters, I am on Windows XP running Python 2.4.3. > -- > Jeffrey Barish >=20 >=20 > -------------------------------------------------------------- > ----------- > Using Tomcat but need to do more? Need to support web=20 > services, security? > Get stuff done quickly with pre-integrated technology to make=20 > your job easier > Download IBM WebSphere Application Server v.1.0.1 based on=20 > Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057& dat=3D121642 |
From: Jeffrey B. <jef...@ea...> - 2006-07-11 17:38:38
|
On Tuesday 11 July 2006 08:45, Heikki Salo wrote: > There are currently only two samples that use sounds: sampleShipEffects.py > uses the d3d.Sound (with 3D effect in newer versions) and samplewx.py uses > the d3d.Media. The objects are pretty simple to use, so there really is not > that much to show. > > The Media-object (uses DirectShow) can play pretty much anything if corrent > codecs (or filters) are registered. Sound (uses DirectSound) can only play > .wav files. Googling for "directshow filter/codec <wanted format>" will > probably find quite a few of them. The codecs are usually .exe-files that > will register themself when installed. After this the Media should be able > to play the formats that the codec supports. > > There are some bad codecs out there, so if possible try to get some > information about them. Also note that .mp3 (and some other formats too) is > supported directly by the DirectShow so there is usually no need to install > any codecs in order to play them. > > -- > Heikki Salo Thank you for your quick response. I found sampleShipEffects.py. Emulating the code therein for playing a sound, I tried: >>> import d3d >>> snd = d3d.Sound(u'c:/windows/media/tada.wav', True) Traceback (most recent call last): File "<pyshell#1>", line 1, in ? snd = d3d.Sound(u'c:/windows/media/tada.wav', True) Error: An invalid parameter was passed to the returning function Also, when I try to run sampleShipEffects, it fails with: Traceback (most recent call last): File "C:\Python24\Lib\site-packages\directpy\samples\sampleShipEffects.py", line 156, in ? frame = SceneSample2(u"Ship and effects") File "C:\Python24\lib\site-packages\directpy\d3dx.py", line 572, in __init__ fullscreen, CREATE.HARDWARE) RuntimeError: Failed to create a device I found an ogg decoder at Free-Codecs.com (which seems actually to be from illiminable). I have installed it, so I hope that once I get past these startup glitches, I will be able to play an ogg file using DirectPython. Also, where do I find documentation for the DirectSound and DirectShow sound-related objects? Besides playing a sound file, there are few more functions that I need: I need to be able to get the current position (time) of playback while a sound file is playing. I need to be able to specify a starting time for play. And I need to be able to stop (or pause) playback. Are those operations possible with DirectX? In case it matters, I am on Windows XP running Python 2.4.3. -- Jeffrey Barish |
From: Heikki S. <ho...@gm...> - 2006-07-11 14:49:07
|
> -----Original Message----- > From: dir...@li...=20 > [mailto:dir...@li...]=20 > On Behalf Of Jeffrey Barish > Sent: 11. hein=E4kuuta 2006 4:11 > To: dir...@li... > Subject: [DirectPython] Examples >=20 > Are there any examples of how to use DirectPython to produce=20 > sound? It appears that all the programs in directpy\samples=20 > are for graphical operations. >=20 > Also, I will need audio codecs. I don't know DirectSound,=20 > but I assume that it provides only hooks for codecs, not the=20 > codecs themselves. If that is true, is it possible to find=20 > decoders packaged for DirectSound for ogg, WMA, AAC, and MP3? > -- > Jeffrey Barish >=20 >=20 > -------------------------------------------------------------- > ----------- > Using Tomcat but need to do more? Need to support web=20 > services, security? > Get stuff done quickly with pre-integrated technology to make=20 > your job easier Download IBM WebSphere Application Server=20 > v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057& > dat=3D121642 > _______________________________________________ > directpython-general mailing list > dir...@li... > https://lists.sourceforge.net/lists/listinfo/directpython-general >=20 There are currently only two samples that use sounds: = sampleShipEffects.py uses the d3d.Sound (with 3D effect in newer versions) and samplewx.py = uses the d3d.Media. The objects are pretty simple to use, so there really is = not that much to show.=20 The Media-object (uses DirectShow) can play pretty much anything if = corrent codecs (or filters) are registered. Sound (uses DirectSound) can only = play .wav files. Googling for "directshow filter/codec <wanted format>" will probably find quite a few of them. The codecs are usually .exe-files = that will register themself when installed. After this the Media should be = able to play the formats that the codec supports. There are some bad codecs out there, so if possible try to get some information about them. Also note that .mp3 (and some other formats too) = is supported directly by the DirectShow so there is usually no need to = install any codecs in order to play them.=20 -- Heikki Salo |
From: Jeffrey B. <jef...@ea...> - 2006-07-11 01:11:21
|
Are there any examples of how to use DirectPython to produce sound? It appears that all the programs in directpy\samples are for graphical operations. Also, I will need audio codecs. I don't know DirectSound, but I assume that it provides only hooks for codecs, not the codecs themselves. If that is true, is it possible to find decoders packaged for DirectSound for ogg, WMA, AAC, and MP3? -- Jeffrey Barish |
From: Heikki S. <ho...@gm...> - 2006-06-21 14:54:23
|
> -----Original Message----- > From: dir...@li...=20 > [mailto:dir...@li...]=20 > On Behalf Of Jamison Prianos > Sent: 21. kes=E4kuuta 2006 8:37 > To: dir...@li... > Subject: [DirectPython] DirectPython with Pyogre >=20 > Hello all.. >=20 > I'm new to DirectPython, but it seems to be exactly what I=20 > want for input in my engine. I'm using Pyogre (python=20 > binding to the C OGRE rendering > libraries) for the graphics in the program and would like to=20 > figure out a way to use DirectPython for my Input and Audio. =20 > The problem I'm having is that I don't receive any messages=20 > on d3d.getMessages() when using Pyogre's window for d3d. >=20 > I'm initialising d3d with the following: > d3d.createDevice(u'', u'', 0, 0, False, CREATE.HARDWARE,=20 > self.graphics.hWnd) >=20 > My d3d.Media and d3d.Sound work just fine in this setup, but=20 > when I watch for .getMessages() I get nothing from the Pyogre=20 > window, no mouseMoves, no windowResizes, nada. >=20 > When I change the device to 'd3d.createDevice()' it creates a=20 > second window > (obviously) for DirectPython and I get all my messages=20 > spilling into the print log as intended. Is there something=20 > else I have to do in order to have DirectPython be able to=20 > intercept inputs to a foreign window? I know there are=20 > examples of uses in WxPython and some other frameworks that=20 > use a non-native window, but I don't see anything in there in=20 > regards to hooking the input from another framework. The=20 > Pyogre input handling leaves much to be desired, so any help=20 > in this would be greatly appreciated. >=20 > -Jamison Prianos >=20 I have't tried DP with PyOgre, but usually when you pass a window handle = to createDevice() it is best to use some other method than getMessages(). = Note that wx and winapi examples don't call getMessages() at all, they use = the message handling stuff provided by the library. When a message is sent = to a window it is placed on the message queue or sometimes posted directly to = the message handler. It is likely that PyOgre has it's own message handler = that handles and discards these messages before getMessages() has a chance to = get them. There is no simple way to prevent this. If you really want to get all messages you can try to hook the window. = There are some libraries that allow you to do that. By the way, if you don't use any DP rendering calls but only Media, = Sound and Input, you can also pass the window handle as the second = (undocumented, but don't worry as it's not going to change) argument to showWindow(SHOW.SHOW, self.graphics.hWnd). This doesn't create internal rendering objects and saves some resources. -- Heikki Salo |
From: Jamison P. <jam...@in...> - 2006-06-21 05:36:48
|
Hello all.. I'm new to DirectPython, but it seems to be exactly what I want for input in my engine. I'm using Pyogre (python binding to the C OGRE rendering libraries) for the graphics in the program and would like to figure out a way to use DirectPython for my Input and Audio. The problem I'm having is that I don't receive any messages on d3d.getMessages() when using Pyogre's window for d3d. I'm initialising d3d with the following: d3d.createDevice(u'', u'', 0, 0, False, CREATE.HARDWARE, self.graphics.hWnd) My d3d.Media and d3d.Sound work just fine in this setup, but when I watch for .getMessages() I get nothing from the Pyogre window, no mouseMoves, no windowResizes, nada. When I change the device to 'd3d.createDevice()' it creates a second window (obviously) for DirectPython and I get all my messages spilling into the print log as intended. Is there something else I have to do in order to have DirectPython be able to intercept inputs to a foreign window? I know there are examples of uses in WxPython and some other frameworks that use a non-native window, but I don't see anything in there in regards to hooking the input from another framework. The Pyogre input handling leaves much to be desired, so any help in this would be greatly appreciated. -Jamison Prianos |
From: Heikki S. <ho...@gm...> - 2006-05-08 21:01:59
|
(This message might have been sent previously, sorry for the spam if you alrady got this) It has been a long time since the last update, but the time has not been (completely...) wasted. Next release should be coming pretty soon. There are some new features, but most of the time has been used to squash bugs. No new and exciting samples have been added altought some old ones have been tweaked. After a few months of field testing DirectPython is probably stable enough to reach beta-stage when the new release is available. So if you have found any fatal bugs (all reports are of course welcome), this would be a good time to let me know. All questions and feedback is read as always. If there is need for some important fix or feature, you should contact me soon. I will probably spend the next 4 months back in the army, so the development of DP is going to slow down considerably. Even reading any feedback can be difficult as I might not have access to my (or any) computer. -Heikki Salo |
From: Heikki S. <ho...@gm...> - 2006-05-07 13:27:49
|
It has been a long time since the last update, but the time has not been (completely...) wasted. Next release should be coming pretty soon. There are some new features, but most of the time has been used to squash bugs. No new & exciting samples have been added altought some old ones have been tweaked. After a few months of field testing DirectPython is probably stable enough to reach beta-stage when the new release is available. So if you have found any fatal bugs (all reports are of course welcome), this would be a good time to let me know. All questions and feedback is read as always. If there is need for some important fix or feature, you should contact me soon. I will probably spend the next 4 months back in the army, so the development of DP is going to slow down considerably. Even reading any feedback can be difficult as I might not have access to my (or any) computer. -Heikki Salo |
From: Heikki S. <ho...@gm...> - 2006-05-06 11:43:58
|
It has been a long time since the last update, but the time has not been (completely...) wasted. Next release should be coming pretty soon. There are some new features, but most of the time has been used to squash bugs. No new and exciting samples have been added altought some old ones have been tweaked. After a few months of field testing DirectPython is probably stable enough to reach beta-stage when the new release is available. So if you have found any fatal bugs (all reports are of course welcome), this would be a good time to let me know. All questions and feedback is read as always. If there is need for some important fix or feature, you should contact me soon. I will probably spend the next 4 months back in the army, so the development of DP is going to slow down considerably. Even reading any feedback can be difficult as I might not have access to my (or any) computer. -Heikki Salo |
From: Heikki S. <ho...@gm...> - 2006-04-11 13:16:38
|
Finally 0.3.0 is out. Old code may not work without some search & replace operations but otherwise changes are relatively small. Next releases might be released as .zip files containing only minimal runtime updates because I don't plan to add much more samples or data. Here is the part of the readme.txt that has all major changes listed: =========================================================== VERSION 0.3.0 =========================================================== Changes: -------- -Minor bug fixes. -New optional arguments in d3d.drawVertices(). The function now also supports objects with buffer protocol. -New FVF-codes added and some old were renamed. This was done to get better mapping between C++ and Python documentation. Now all FVF codes are supported and d3dx.checkFVF is deprecated. -CREATE.PRESERVEFPU now works properly. -More supported texture formats. -More (auch!) constants for d3d.setState(), see d3dc.COMMAND -New values in d3d.getCaps() -d3d.Media no longer hangs when playing audio files and the window is repainted. -d3d.getScreenshot() modified. -Deprecated function d3d.window() has now been removed. -It is now possible to modify rendered sprites or texts by using a matrix/transformation. Use MATRIX.SPRITE -Some samples updated. -New file: meshviewer.py -New sample: sampleNumpy.py |
From: Heikki S. <ho...@gm...> - 2006-04-02 16:55:30
|
The final release of DirectPython 0.3.0 is getting closer. Nothing radical has been done but some new features have been implemented that might alter the behaviour of existing code in certain cases. The changes are documented in the readme.txt as usual. After this release the version numbering might not grow as fast as it has done before. This makes it easier to create simple runtime updates that can be released more often. The future release of Python 2.5 will probably introduce a new version of DirectPython carrying version number 0.3.1 There can be some API changes between these two DP versions if certain features are present in the Python 2.5 This behaviour probably sounds worse than it really is. The release is planned to occur within two weeks if everything goes smoothly. Ideas, suggestions and bug reports are still accepted as always. |
From: Heikki S. <ho...@gm...> - 2006-03-28 23:16:42
|
This post provides general information about the current state of DirectPython. This includes new features, bug fixes and similar matters. What is coming to the next version: -Camera class in d3dx Fixes: 1459288 Feel free to suggest new features or report bugs. |
From: Heikki S. <ho...@gm...> - 2006-03-27 18:53:12
|
First post, testing. |