POV-Ray : Newsgroups : povray.newusers : multiple renderings with #while ? : Re: multiple renderings with #while ? Server Time
28 Jul 2024 20:23:19 EDT (-0400)
  Re: multiple renderings with #while ?  
From: Alain
Date: 10 Oct 2007 10:55:23
Message: <470ce7db$1@news.povray.org>
flatline nous apporta ses lumieres en ce 2007/10/10 09:41:
> I would like to generate  renderings of the same scene from multiple
> viewpoints (specifically moving the camera on a sphere while looking at its
> center):
> 
> is it possible to generate the renderings from within a #while loop
> and put them into different files?
No! While loops are usefull for placing many objects and many other things, but 
are of no use for that purpose.
> 
> Thanks a lot!
> 
> 
> 
> 
> 
What you can do is to use the animation feature to do just that.
Add +kffn to the command line. (replace the "n" by the number of frames you want)
Place the camera for the first image.
If you want the camera to make a circle around the scene add rotate 360*y*clock, 
to make an horzontal circle, at the end of the camera deffinition.
To make 3 rotations:
camera{location -10*z
	#if(clock< 1/3)rotate 360*3*clock*y // circle on x-z plane
	#else #if(clock< 2/3)rotate 360*3*clock*x // circle on y-z plane
	#else rotate 90*x rotate 360*3*clock*z // circle on x-y plane
	#end //second #if
	#end //first #if
}
This allow you to get any arbitrary number of views.

You can also use frame_number and switch(frame_number) and case to place the 
camera to specific points:
camera{location -10*z look_at 0
#switch(frame_number)
	#case(1)#break //no movement
	#case(2) rotate 90*y #break //look from left
	#case(3) rotate -90*y #break //look from right
	#case(4) rotate 180*y #break //look from beheind
	#case(5) rotate 90*x #break //look from top
	#case(6) rotate -90*x //look from bottom
//last element so #break is not needed
#end
}
And set +kff6
This solution is only viable for a limited number of view points.

-- 
Alain
-------------------------------------------------
I feel like I'm diagonally parked in a parallel universe.


Post a reply to this message

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