POV-Ray : Newsgroups : povray.animations : Animating Sombrero.png? Server Time
23 Nov 2024 09:13:16 EST (-0500)
  Animating Sombrero.png? (Message 1 to 3 of 3)  
From: DranoMax
Subject: Animating Sombrero.png?
Date: 9 Nov 2010 15:05:00
Message: <web.4cd9a8fbebc9549ab6bda1ce0@news.povray.org>
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

From: Stephen
Subject: Re: Animating Sombrero.png?
Date: 9 Nov 2010 15:40:44
Message: <4cd9b1cc$1@news.povray.org>
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

From: Alain
Subject: Re: Animating Sombrero.png?
Date: 9 Nov 2010 19:39:00
Message: <4cd9e9a4@news.povray.org>

> 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

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