prev index next |
Rendering
and Output
|
POV-Ray Tips,
Tricks, and Techniques |
Output Animation
Files Without Rendering?
|
XGamer is discouraged: | I am pretty sure this can't be done, but I thought I'd
ask anyway... :)
Let's say I have a source file that uses the internal animation clock.
Is there any way that I can have POV-Ray just spit out a series of source
files with the clock variable changed for each frame rather than having
it automatically rendering the frames and giving me the .tga's? Basically,
I want to use POV to calculate the clock variable for each frame and just
have the source files, not the .tga's.
|
|
Chris Colefax responds:
|
Why not just use a simple scripting tool (I still use DOS
for all my POVRay work so I would probably use QBasic!) to create a small
program that will create the files for you?
|
|
Paul T. Dawson comes to the rescue: | Chris is correct - sometimes Basic is the fastest way to
create an ASCII file for POV-Ray. However, there are a few problems - first,
not everyone has Basic on their machine, and second, Basic can NOT easily
do POV-Ray-Style-Calculations. For example:
#declare VEC = vrotate ( < 3, 4, 5 >, < 20, 70, 90 > ) You *could* calculate that in Basic, but it would be a project. What
we really need is a program that:
Well, the program exists, it's called POV-Ray! 8-) Anyone on the IRTC list will probably remember that I developed this technique a while ago, for writing a POV-Ray file *with* POV-Ray itself. Here's an example INI and POV-Ray file. The only output you get from this is an ASCII text file called DEBUG.OUT. That's the key! You can use any POV-Ray function to do calculations, and then write all of the results to the debug stream (and the debug file). ;//- CUT HERE - CUT HERE - CUT HERE -
Input_File_Name=TEST.POV
;//- END - TEST.INI
//- CUT HERE - CUT HERE - CUT HERE -
sphere { 0, 0.1 pigment { color rgb 1 } } #declare VEC = vrotate ( < 3, 4, 5 >, < 20, 70, 90 > )
#debug concat ( chr(13), chr(10) )
#debug concat ( "clock =", str(clock,9,4), chr(13), chr(10) )
//- END - TEST.POV
In the INI file, both Display and Output_To_File are turned off, so this doesn't actually render anything. But it does demonstrate the process of writing text with POV-Ray. Just keep adding #debug statements to create any ASCII output you want. One problem is that the DEBUG.OUT file is always *one* file, and you might have to cut it apart with a text editor. But... it does all those POV-Ray calculations for you! Oh, the little sphere in the scene is *required*, or POV-Ray will complain that there isn't anything in the scene. Also, I used chr(13),chr(10) instead of the POV-Ray newline, because this works better in DOS/WIN. So, you can take that idea and add to it, like...
The original question (on the IRTC list) had to do with placing hundreds of random trees on a grid. Using this process, it was possible to create an *editable* file with all the trees in it. That made it a lot easier to change the scene around. Well, I hope this gives you all some ideas!
|
|