POV-Ray : Newsgroups : povray.newusers : image map and batch render Server Time
12 Oct 2024 09:50:56 EDT (-0400)
  image map and batch render (Message 1 to 7 of 7)  
From: Peter bates
Subject: image map and batch render
Date: 4 Mar 2022 09:35:00
Message: <web.622221a363092888b54f4c53223435db@news.povray.org>
Platfor: in 10
Version: 3.7

Hi  all!

I have 1500 stl files to convert to jpg images. I used stl2inc to create the
files and renamed the objects inside the .inc definitions to the same, to make
the povray script easier.

1) I am using a bmp image of a piece of wood (attached) to imagemap onto a block
for the base of the scene (.pov also attached). This results in a
blurry/stretched image - how can this be fixed?

2) How can I run the same .pov scene file on each .inc file? My idea is: use
python to create .pov files by changing the #define foo.inc line for each inc
file, creating a batch of .pov files that can then be run in Windows batch. Is
there a better way?

Thanks!


Post a reply to this message


Attachments:
Download 'cutterscene2.rar.dat' (2946 KB)

From: jr
Subject: Re: image map and batch render
Date: 4 Mar 2022 11:05:00
Message: <web.622237d9d7f80b35ed36e5cb6cde94f1@news.povray.org>
hi,

"Peter.bates" <Pet### [at] livecoza> wrote:
> Platfor: in 10
> Version: 3.7
>
> Hi  all!
>
> I have 1500 stl files to convert to jpg images. I used stl2inc to create the
> files and renamed the objects inside the .inc definitions to the same, to make
> the povray script easier.
>
> 1) I am using a bmp image of a piece of wood (attached) to imagemap onto a block
> for the base of the scene (.pov also attached). This results in a
> blurry/stretched image - how can this be fixed?

(guessing) make sure aspect ratio + scaling .. are in harmony.


> 2) How can I run the same .pov scene file on each .inc file? My idea is: use
> python to create .pov files by changing the #define foo.inc line for each inc
> file, creating a batch of .pov files that can then be run in Windows batch. Is
> there a better way?

you could use the command-line "constant" to supply (part of) a filename.
<https://wiki.povray.org/content/Reference:Scene_Parsing_Options>

(though you'll need to find the right combination of quotes + apostrophes around
the value(s).  sorry, not using MS Win)


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: image map and batch render
Date: 4 Mar 2022 14:00:00
Message: <web.622260bed7f80b351f9dae3025979125@news.povray.org>
"Peter.bates" <Pet### [at] livecoza> wrote:
> Platfor: in 10
> Version: 3.7
>
> Hi  all!
>
> I have 1500 stl files to convert to jpg images. I used stl2inc to create the
> files and renamed the objects inside the .inc definitions to the same, to make
> the povray script easier.
>
> 1) I am using a bmp image of a piece of wood (attached) to imagemap onto a block
> for the base of the scene (.pov also attached). This results in a
> blurry/stretched image - how can this be fixed?

Your image is 977x1526.
POV-Ray will import this and map it to a 1-POV-unit square.
So what you need to do is scale that texture to resize back to the right aspect
ratio.   (Just like jr said)

> 2) How can I run the same .pov scene file on each .inc file? My idea is: use
> python to create .pov files by changing the #define foo.inc line for each inc
> file, creating a batch of .pov files that can then be run in Windows batch. Is
> there a better way?

If you name all of your files in sequential numerical order, you can use the
animation feature, and use the frame number or the clock value to choose the
right file.  Just concatenate everything into a string and use that for the
filename.

- Bill


Post a reply to this message

From: kurtz le pirate
Subject: Re: image map and batch render
Date: 5 Mar 2022 04:27:34
Message: <62232d06$1@news.povray.org>
On 04/03/2022 19:55, Bald Eagle wrote:

> If you name all of your files in sequential numerical order, you can use the
> animation feature, and use the frame number or the clock value to choose the
> right file.  Just concatenate everything into a string and use that for the
> filename.
> 

As Bill say, animation feature is a key.

-> Name yours file sequential : File1.inc, File2.inc, ... File1500.inc
-> In your SDL code, build the file name string :
   #declare fileName = concat("File",str(frame_number,0,0),".inc");
-> Include the file :
   #include fileName
-> Of corse, turn on animation and set
   Initial_Frame=1 and Final_Frame=1500


<https://wiki.povray.org/content/Reference:Animation_Options#Internal_Animation_Loop>



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Alain Martel
Subject: Re: image map and batch render
Date: 5 Mar 2022 12:27:14
Message: <62239d72$1@news.povray.org>
Le 2022-03-05 à 04:27, kurtz le pirate a écrit :
> On 04/03/2022 19:55, Bald Eagle wrote:
> 
>> If you name all of your files in sequential numerical order, you can use the
>> animation feature, and use the frame number or the clock value to choose the
>> right file.  Just concatenate everything into a string and use that for the
>> filename.
>>
> 
> As Bill say, animation feature is a key.
> 
> -> Name yours file sequential : File1.inc, File2.inc, ... File1500.inc
> -> In your SDL code, build the file name string :
>     #declare fileName = concat("File",str(frame_number,0,0),".inc");
> -> Include the file :
>     #include fileName
> -> Of corse, turn on animation and set
>     Initial_Frame=1 and Final_Frame=1500
> 
> 
>
<https://wiki.povray.org/content/Reference:Animation_Options#Internal_Animation_Loop>
> 
> 
> 
In this case, it's usually better to use constant file name length. So...
#declare fileName = concat("File",str(frame_number,-4,0),".inc");
The -4 means at least four digits and left padded with zeros.
The zero mean no decimal part.

File0001.inc, File0002.inc, ... File1500.inc


Post a reply to this message

From: Leroy
Subject: Re: image map and batch render
Date: 28 Mar 2022 15:00:00
Message: <web.624204e6d7f80b35b78ae31df712fc00@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
> > On 04/03/2022 19:55, Bald Eagle wrote:
> >
> >> If you name all of your files in sequential numerical order, you can use the
> >> animation feature, and use the frame number or the clock value to choose the
> >> right file.  Just concatenate everything into a string and use that for the
> >> filename.
> >>
> >
> > As Bill say, animation feature is a key.
> >
> > -> Name yours file sequential : File1.inc, File2.inc, ... File1500.inc
> > -> In your SDL code, build the file name string :
> >     #declare fileName = concat("File",str(frame_number,0,0),".inc");
> > -> Include the file :
> >     #include fileName
> > -> Of corse, turn on animation and set
> >     Initial_Frame=1 and Final_Frame=1500
> >
> >
> >
<https://wiki.povray.org/content/Reference:Animation_Options#Internal_Animation_Loop>
> >
> >
> >
> In this case, it's usually better to use constant file name length. So...
> #declare fileName = concat("File",str(frame_number,-4,0),".inc");
> The -4 means at least four digits and left padded with zeros.
> The zero mean no decimal part.
>
> File0001.inc, File0002.inc, ... File1500.inc

 Here something if the files you want to include aren't ordered as above or even
named the same. Make a file containing all the filenames you want. Then read
that file up to the current frame in the animation. That will be the your
include file.
I have winXP and I use this dos bat file to copy all the files in a directory.

REM make the file 'AAA_List.txt'  of 'txt' files from the directory where it
this is located
dir *.txt /A:-D/B/O:N > AAA_List.txt

just save in the directory where the files are and run
then I use POV win editor to add a quotes before and after the file name & a
comma at the end of each line


Post a reply to this message

From: Alain Martel
Subject: Re: image map and batch render
Date: 29 Mar 2022 13:20:51
Message: <62433ff3$1@news.povray.org>
Le 2022-03-28 à 14:59, Leroy a écrit :

>   Here something if the files you want to include aren't ordered as above or even
> named the same. Make a file containing all the filenames you want. Then read
> that file up to the current frame in the animation. That will be the your
> include file.
> I have winXP and I use this dos bat file to copy all the files in a directory.
> 
> REM make the file 'AAA_List.txt'  of 'txt' files from the directory where it
> this is located
> dir *.txt /A:-D/B/O:N > AAA_List.txt
> 
> just save in the directory where the files are and run
> then I use POV win editor to add a quotes before and after the file name & a
> comma at the end of each line
> 
> 
> 
> 
This .bat file will work from MS DOS 3 up to Windows 11 and probably 
beyond. MS DOS did not support folders before version 3.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.