ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/genclock.c
(Generate patch)

Comparing ray/src/gen/genclock.c (file contents):
Revision 2.1 by greg, Thu May 25 16:34:47 1995 UTC vs.
Revision 2.2 by greg, Fri May 26 10:18:35 1995 UTC

# Line 125 | Line 125 | double hour;
125  
126          printf("\nhand_paint polygon %s.hour_hand\n", name);
127          printf("0\n0\n12\n");
128 <        rvert(.06, -.03, -.03, hrot);
129 <        rvert(.06, .03, -.03, hrot);
128 >        rvert(.06, -.03, -.06, hrot);
129 >        rvert(.06, .03, -.06, hrot);
130          rvert(.06, .025, .5, hrot);
131          rvert(.06, -.025, .5, hrot);
132  
133          printf("\nhand_paint polygon %s.minute_hand\n", name);
134          printf("0\n0\n12\n");
135 <        rvert(.07, -.02, -.04, mrot);
136 <        rvert(.07, .02, -.04, mrot);
135 >        rvert(.07, -.02, -.1, mrot);
136 >        rvert(.07, .02, -.1, mrot);
137          rvert(.07, .01, .9, mrot);
138          rvert(.07, -.01, .9, mrot);
139   }
# Line 142 | Line 142 | double hour;
142   rvert(x, y, z, ang)                     /* print rotated vertex */
143   double  x, y, z, ang;
144   {
145 <        double  sa, ca;
145 >        static double   lastang=0, sa=0, ca=1;
146  
147 <        sa = sin(-ang);
148 <        ca = cos(-ang);
147 >        if (ang != lastang) {
148 >                sa = sin(-ang);
149 >                ca = cos(-ang);
150 >                lastang = ang;
151 >        }
152          printf("%15.12g %15.12g %15.12g\n", x, y*ca-z*sa, z*ca+y*sa);
153   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines