From: Lorenzo I. <lor...@gm...> - 2008-01-14 11:47:48
|
Hello, I am stepping back from my previous post, when I was asking how to make a movie in vpython. That was too ambitious then. I managed to get some decent animations on my laptop (running Debian testing); now my question is how to get at least a set of png (or any other decent format; pdf, eps, jpg etc...) files with the "snapshots" of my system. I do not think I can do that directly from the window showing my animation, but I have not been able to find online a code showing how to achieve that. Any help here is really welcome! Many thanks Lorenzo |
From: <fre...@gb...> - 2008-01-14 12:22:27
Attachments:
movie3D.py
|
Le 14/1/2008, "Lorenzo Isella" <lor...@gm...> a =E9crit: >I am stepping back from my previous post, when I was asking how to >make a movie in vpython. >That was too ambitious then. >I managed to get some decent animations on my laptop (running Debian >testing); now my question is how to get at least a set of png (or any >other decent format; pdf, eps, jpg etc...) files with the "snapshots" >of my system. >I do not think I can do that directly from the window showing my >animation, but I have not been able to find online a code showing how >to achieve that. Why don't you use povexport? You generate .pov files, and you can then process them by a simple script, and build the movie. I attached a script I've done 3 years ago, for a student in order to generate this: http://www.gbiloba.org/download/SNP-definitif-640x480avi -- Fr=E9d=E9ric |
From: Bruce S. <Bru...@nc...> - 2008-01-14 23:34:42
|
The URL you give is not valid. Can you please explain the heart of your program, the function generateMovie? I don't understand what is involved in combining many png images into a movie. What is the format of the movie? How does one view such a movie? Also, I don't see where/how the povexport facility is invoked (povexport is a routine available on the home page of vpython.org). Maybe it's buried inside the module "Scene3D" which you don't include? Bruce Sherwood Frédéric wrote: > Le 14/1/2008, "Lorenzo Isella" <lor...@gm...> a écrit: > > >>I am stepping back from my previous post, when I was asking how to >>make a movie in vpython. >>That was too ambitious then. >>I managed to get some decent animations on my laptop (running Debian >>testing); now my question is how to get at least a set of png (or any >>other decent format; pdf, eps, jpg etc...) files with the "snapshots" >>of my system. >>I do not think I can do that directly from the window showing my >>animation, but I have not been able to find online a code showing how >>to achieve that. > > > Why don't you use povexport? You generate .pov files, and you can then > process them by a simple script, and build the movie. > > I attached a script I've done 3 years ago, for a student in order to > generate this: > > http://www.gbiloba.org/download/SNP-definitif-640x480avi > > > -- > Frédéric |
From:
<fre...@gb...> - 2008-01-15 07:04:25
|
On mardi 15 janvier 2008, Bruce Sherwood wrote: > The URL you give is not valid. There is just a missing dot just before 'avi'... Sorry! > Can you please explain the heart of your program, the function > generateMovie? I don't understand what is involved in combining many png > images into a movie. What is the format of the movie? How does one view > such a movie? > > Also, I don't see where/how the povexport facility is invoked (povexport > is a routine available on the home page of vpython.org). Maybe it's > buried inside the module "Scene3D" which you don't include? Ok. The povexport.pov() function is called in the scene.pov() method. It=20 generates the pov file with the given filename of the current scene. But=20 this method is call through __povexport(), which also call povray to=20 generate the png image. The idea is to define some points where we go in straight line. This is=20 done in the move() method. By points I mean 2 things: the spectrometer=20 position, and the camera position (for zooms). All this is given in the=20 mvt dict. Most of keys are send to sub-objects, and are just angles of=20 differents spectro parts. At each step in the move(), we call the draw method, which in turn refresh= =20 all sub-objects and also generate a png image. There is also a wait() method, which just to generate images at the same=20 position, with respect of the timing. Last, there is a neutron object which can move along a pre-defined line,=20 and which also call the __povexport() method (through its newFrameSignal()= =20 object, binded to that method). At the end, we have all png images. The generateMove() method build a movie= =20 from that, using mplayer (Don't ask me for all options; a friend gave them= =20 to me!). Hope this helps. Feel free to ask for more informations. =2D-=20 Fr=E9d=E9ric http://www.gbiloba.org |