POV-Ray : Newsgroups : povray.newusers : Save an image to disk from code. : Re: Save an image to disk from code. Server Time
29 Jan 2023 20:59:50 EST (-0500)
  Re: Save an image to disk from code.  
From: Alain Martel
Date: 25 Oct 2019 10:57:15
Message: <5db30d4b$1@news.povray.org>
Le 2019-10-23 à 09:53, ale### [at] gmailcom a écrit :
> Hello everybody.
> I'm using rand to generate image with different random sizes, i have to draw
> wires and i choose randomly start and end points.
> I want to draw different multiple images in "automatic" way.
> For example if a want to draw 100 images i wuold like to know if it is possibile
> to iterate in my script 100 times and save from code the different 100 generated
> images in the script.
> 
> 
> 

Use the animation feature.

You can use frame_mumber to seed your random stream :

#declare R= seed(frame_number);

You also can  use the clock variable :

#declare R= seed(clock*1000);

In both cases, you can add some constant. You can combine both :

#declare R= seed(frame_number*2+12 + clock*100+3);

Use rand(R) in your scene.

Then, place +kff100 on the command line.
For the Windows version, the command line is the text box just to the 
right from the resolution selector.
Hit the Run button and you'll get 100 uniquely numbered images. The 
number is frame_number.



Alain


Post a reply to this message

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