POV-Ray : Newsgroups : povray.animations : My Rolling Egg problem solution : My Rolling Egg problem solution Server Time
28 Jul 2024 18:16:04 EDT (-0400)
  My Rolling Egg problem solution  
From: Josh English
Date: 23 Apr 1999 11:29:35
Message: <37208384.9BE05E97@spiritone.com>
Attached is a QT Movie that should work now. (I had to save them
flattened instead of normal, which I didn't have to do before.)

Once again here is the code:
// clock goes from 0 to 1
#declare anim_clock = clock;

#declare x_scale = 0.5;
#declare y_scale = 1;

#declare rotation = anim_clock * 180;
#declare roff = 90;

#declare centerX = cos(radians(rotation-roff))*x_scale;
#declare centerY = sin(radians(rotation-roff))*y_scale;
#declare p = <centerX,centerY,0>;

#declare circumference = 2*pi*sqrt(( pow(x_scale,2) + pow(y_scale,2) ) /
2 );
#declare half = circumference / 2;
#declare quarter = circumference / 4;


#declare f1 = sqrt( abs ( pow(x_scale,2) - pow(y_scale,2) ) );
#declare f2 = -f1;


#declare foci1 = <0,f1,0>-p;
#declare foci2 = <0,f2,0>-p;

#declare a1 = degrees ( atan2 ( foci1.x,foci1.y));
#declare a2 = degrees ( atan2 ( foci2.x,foci2.y));
#declare a3 = ( a1 + a2 )/2;

// translate across x axis
#declare translation = circumference *rotation/360;


plane { y, 0 pigment { checker scale quarter } }

sphere { <0,0,0> 1
         pigment { radial frequency 8 rotate 90*x}
         scale <x_scale,y_scale,0.125>
         translate -p
         rotate a3*z
         translate translation*x
         }

camera { location  <translation + 2, y_scale, -3.5>
         angle 65
         right     4/3*x
         look_at   <translation, y_scale,  0.0>
         //orthographic
        }


Josh


Post a reply to this message


Attachments:
Download 'sidecircle2.mov' (414 KB)

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