prev index next 
Miscellaneous, Odds & Ends 
 POV-Ray Tips, 
 Tricks, and Techniques
"Feed" LParser to POV-Ray on Command Line? 
 
Debbie & Julie Pitman ask: How do you "feed" LParser to POV-Ray on the command line?  I am using LParser 4.00 with POV-Ray. 
 
Richard Adams commiserates:
I had major problems with this too. It took me forever to figure out how to use lparser to generate the correct pov files. When I finally figured it out, I worte a batch file to automate the process. With this batch file, making a POV file from any given .ls file becomes almost automatic. Below is the batch file I wrote: 

******************************************** 

rem this batch file is called MAKEPOV.BAT and is written by 
rem Richard Adams 
@echo off 
echo this is a batch file to make it as simple as possible to create POV-Ray files 
echo from the input *.LS lparser file. 
echo+ 
echo now we'll run the lparser program. 
pause 
rem We must make sure these files are not present, or they'll interfere 
rem with the POV-Ray conversion. 
if exist info.txt del info.txt 
if exist output.vol del output.vol 
if exist output.inc del output.inc 
if exist output.pov del output.pov 
if exist lpar2pov.inc del lpar2pov.inc 
if exist lpar2pov.pov del lpar2pov.pov 
lparser -c %1 %2 %3 %4 %5 %6 %7 %8 %9 
echo pause lparser has to run twice to produce the necessary files for 
echo conversion to the POV-Ray format. Sorry about this, but that's the way the 
echo authors wrote the programs. 
pause 
lparser -vc %1 %2 %3 %4 %5 %6 %7 %8 %9 
echo Now the viewer will run. Be SURE to press F2 once BEFORE you change 
echo the views, then F2 a SECOND time AFTER you change the views. Press F2 
echo twice even if you don't change the view at all. 
pause 
lviewer output 
echo And finally the LV2POV POV output generator will run. 
pause 
lv2povid 2 
echo done! :) 

******************************************** 

This is a command line program. If you have, for example, an lparser file you want to turn into a POV file named test.ls, you type: 

makepov test.ls 

on the DOS command line. The batch file will then do all the rest, and give you a couple of instructions needed to make sure the POV-Ray file turns out correctly. 

That's all there is to it! MAKEPOV will generate two files, LPAR2POV.POV and LPAR2POV.INC. These are the actual POV-Ray files. MAKEPOV will overwrite any previous versions of LPAR2POV.POV and .INC, so if you want to run it on another .LS file you need to rename the old LPAR2POV files. 

I hope this helps. 
 

  1