|  |  | Hello, everyone,
I've been attempting to animate the Sombrero image that is included with PovRay,
but have failed so far...  Has anyone been able to do this, and how?
Thanks.
 Post a reply to this message
 |  | 
|  |  | On 09/11/2010 8:03 PM, DranoMax wrote:
> Hello, everyone,
>
> I've been attempting to animate the Sombrero image that is included with PovRay,
> but have failed so far...  Has anyone been able to do this, and how?
>
> Thanks.
>
>
Sorry to say but that scene is not really made to be animated. Try 
instead any of the scenes in \\scenes\animations\...
Ask away if you have any more questions.
-- 
Best Regards,
	Stephen
 Post a reply to this message
 |  | 
|  |  | 
> Hello, everyone,
>
> I've been attempting to animate the Sombrero image that is included with PovRay,
> but have failed so far...  Has anyone been able to do this, and how?
>
> Thanks.
>
>
It depends on how you want it animated.
Basicaly, it's a single frame static image with no provision for any 
animation in the scene file.
You can rotate the shape. Add a rotate that depends on clock.
You can make the ossilations shift.
Original code:
#declare Zc = -1.0;
#while (Zc<=1.0)
   union
   {
   // Xc goes from -1 to +1
   #declare Xc = -1.0;
   #while (Xc<=1.0)
     // precalculate height, since it is used several places below
     #declare YHeight = sin(sqrt(Xc*Xc+Zc*Zc)*6.28*2);
//change the preceding line to shift the function acording to the clock 
variable.
     object
     {
       BasicShape scale Increment
       translate <Xc, YHeight/4, Zc>
       texture
       {
         // colors change across the object, and also go from black
         // in the valleys to full saturation at the peaks
         pigment { color rgb <Xc/2+1, 1-Zc/2, YHeight/2+1>*YHeight }
         finish { ambient 0.2 specular 0.5 roughness 0.05 reflection 0.2 }
       }
     }
     // manually increment our counter inside the loop
     #declare Xc=Xc+Increment;
   #end
   }
   // manually increment our counters inside the loop
   #declare Zc=Zc+Increment;
#end
Options follow:
#declare YHeight = sin(sqrt(pow(Xc*clock,2)+pow(Zc*clock,2))*6.28*2);
Shift with time
#declare YHeight = sin(sqrt(pow(Xc,2)+pow(Zc,2))*6.28*2*clock);
Raise with time
Alain
Post a reply to this message
 |  |