POV-Ray : Newsgroups : povray.binaries.animations : need help - clock - : Re: need help - clock - Server Time
30 Jun 2024 04:06:00 EDT (-0400)
  Re: need help - clock -  
From: Charles C
Date: 7 Feb 2007 15:00:00
Message: <web.45ca2ef152f9d244704594a90@news.povray.org>
It sounds like you don't care about this class.   Given that while also
considering it'd be cheating for anybody to give you something all written
out, I'll just say put a sphere at the origin for the spindle around which
the hands rotate.  Then, use a disk for the face.  Define a sphere at say
the 12 o'clock position and use a #while loop top copy it around for the
different number locations.   Do the same for the seconds positions, but
maybe with smaller spheres/dots.  Declare 3 different sizes of cylinders or
cones or whatever for the hours minutes & seconds and then...

#declare Duration = 1/60; // expressed in hours so 1/60 = 1 min

#object{ Hour_Hand   rotate clock*360*1    *Duration }
#object{ Minute_Hand rotate clock*360*60   *Duration }
#object{ Second_Hand rotate clock*360*60*60*Duration }

If you want to start at something other than 12:00, you can add a starting
angle to each of the rotations.

Hope this helps,
Charles

PS, a digital clock would be almost as easy but would use float and string
functions.



"nero.corporations" <ner### [at] webde> wrote:
> Ok, to redefine the situation:
>
> - first u must know our teacher is a real IDIOT, i dont know how he got so
> far getting a teacher... he has no knowledge of pc
> - when he says "a clock" you can give him anything that looks similar to a
> clock and hes satisfied (we wrote our test on different pcs, but all got
> the same solution and he didnt notice and gave us all the best mark there
> is)
>
> so i need a clock showing the hours, mins and secs. nothing more... nothing
> special, can be the simplest code there is :P
>
> regards


Post a reply to this message

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