POV-Ray : Newsgroups : povray.general : Automatically rendering multiple views Server Time
23 Dec 2024 22:26:53 EST (-0500)
  Automatically rendering multiple views (Message 1 to 4 of 4)  
From: Randy
Subject: Automatically rendering multiple views
Date: 19 Sep 2006 01:35:00
Message: <web.450f811412afa56b61c8c96c0@news.povray.org>
(This may belong more in the animation group)

I have the desire to be able to render multiple views of my scene file
without having to change the camera position and re-run the render several
times.

I have a variable to declare which camera position I want to use (CamNum,
which can be an integer from 1 to however many camera positions I have
defined).  I use a #switch block to set variables for camera location and
look_at.

What I would like to do is something like set the Final_Frame to the max
number of cameras, and have the scene file automatically render all the
views I have defined.

The problem is really in the fact that I still want to use the same scene
code to render just a single view when that is all I want.

Is there a way to detect that POV's animation loop is in operation, so that
I can set up another #switch or #if block to set the camera location
variable?

Something like:

#declare Cam_Num = 1; //set this value to render a single scene

#if ( some test to determine if the animation loop is running )
  #declare Cam_Num = Clock * (max number of cameras);
#end

#switch (Cam_Num)
  #case (1)
    #declare Cam_Loc = <x,y,z>;
    #declare Cam_Look =<x,y,z>;
    #break
  #case (2)
    ( etc. )


The only other way I thought I could do it was to comment out the first
declaration of the Cam_Num variable and change the #if block to check if
that variable is defined, and then calculate the Cam_Num if it wasn't.

Any thoughts?

Randy


Post a reply to this message

From: Chris B
Subject: Re: Automatically rendering multiple views
Date: 19 Sep 2006 13:29:35
Message: <451028ff$1@news.povray.org>
"Randy" <han### [at] sbcglobalnet> wrote in message 
news:web.450f811412afa56b61c8c96c0@news.povray.org...
> (This may belong more in the animation group)
>
> I have the desire to be able to render multiple views of my scene file
> without having to change the camera position and re-run the render several
> times.
>
> Randy
>

Hi Randy,

I use something like that to do the graphics for the documentation of some 
of my macros so I can regenerate the images in 'batch' mode.
I set a variable at the top, either to a fixed value:

#declare ImageNumber = 50;   // 1 to 50 if only generating a single image

or to be equal to the frame number:

/* Using command line options +kfi40 +kff50 
*/
#declare ImageNumber = frame_number;   // used for generating a sequence of 
images


 then I have a series of #if statements containing the stuff that's unique 
for each image:

#if (ImageNumber = 3)
  #declare Image = "SCDefaultNewelTexture";


I define a name for each image just so that I can write out a script file at 
the end that I can use to rename the files to give me meaningful file names:

#if (ImageNumber != 0)
  #if (frame_number = 0) #write(FileID,"REN StairCaseDoc.bmp ",Image,".bmp 
\n")
  #else #write(FileID,"REN StairCaseDoc",ImageNumber,".bmp ",Image,".bmp 
\n")
  #end
#end

Hope this helps,

Regards,
Chris B.


Post a reply to this message

From: Randy
Subject: Re: Automatically rendering multiple views
Date: 19 Sep 2006 22:50:01
Message: <web.4510ab90d96628161c8c96c0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> Hi Randy,
>
> I use something like that to do the graphics for the documentation of some
> of my macros so I can regenerate the images in 'batch' mode.
> I set a variable at the top, either to a fixed value:
>
> #declare ImageNumber = 50;   // 1 to 50 if only generating a single image
>
> or to be equal to the frame number:
>
> /* Using command line options +kfi40 +kff50
> */
> #declare ImageNumber = frame_number;   // used for generating a sequence of
> images
>
>
>  then I have a series of #if statements containing the stuff that's unique
> for each image:
>
> #if (ImageNumber = 3)
>   #declare Image = "SCDefaultNewelTexture";
>
>
> I define a name for each image just so that I can write out a script file at
> the end that I can use to rename the files to give me meaningful file names:
>
> #if (ImageNumber != 0)
>   #if (frame_number = 0) #write(FileID,"REN StairCaseDoc.bmp ",Image,".bmp
> n")
>   #else #write(FileID,"REN StairCaseDoc",ImageNumber,".bmp ",Image,".bmp
> n")
>   #end
> #end
>
> Hope this helps,
>
> Regards,
> Chris B.

DOH !

Ever have one of those moments?

I had not found the built-in identifier "frame_number".

Armed with this tidbit, I think I can automate the generation of my various
views quite nicely !

Thanks much, Chris.


Post a reply to this message

From: Randy
Subject: Re: Automatically rendering multiple views
Date: 20 Sep 2006 00:10:01
Message: <web.4510be19d96628161c8c96c0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:

>
>(helpful stuff I removed)
>

Thanks much for pointing me to a section of the POV help files that I had
usually just skipped over.  This has helped me to write some code that does
almost everything I want.

Now I'm going to have to have POV write a .bat file to run as a post-frame
shell command to rename the output so that it ends up exactly the way I
want it (but that will have to wait for tomorrow night).

My solution to rendering various cameras automagically:

//The camera
#if (clock_on = 0)
  #declare Cam_Num = 1; //Value of desired camera for single frame render
                        // (edit this value before rendering)
#else
  //To automatically render multiple times with different cameras,
  //set the scene's initial and final frames
  //i.e. put +KFI3 +KFI5 on the command line
  //to render frames 3 through 5
  #declare Cam_Num = frame_number;
#end

#debug concat("nCamera Number: ", str(Cam_Num,2,1), "nn")

#switch (Cam_Num)
  #case (1) // Standard view
    #declare Cam_Pos = <9*Ft, 5*Ft, -20*Ft>;
    #declare Cam_Look = <9*Ft, 5*Ft,  0.0>;
  #break
  #case (2) // Close-up of piston box
    #declare Cam_Pos = <10*Ft, 3*Ft, -10*Ft>;
    #declare Cam_Look = <10*Ft, 3*Ft, 0*Ft>;
  #break
  .
  .
  .

Thanks again, Chris B. !!


Post a reply to this message

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