home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Homebrewer's Handbook / vr.iso / vroom / clock.pas < prev    next >
Pascal/Delphi Source File  |  1996-03-19  |  1KB  |  36 lines

  1. unit clock;
  2.  
  3. interface
  4.  
  5. uses vroom;
  6.  
  7. type clock_3d=object
  8.           face, hand1, hand2 : file_object3d;
  9.           h1r, h2r : real;
  10.           procedure Init(x1, y1, z1, h1rottime, h2rottime : real);
  11.      end;
  12.  
  13. implementation
  14.  
  15. procedure clock_3d.Init(x1, y1, z1, h1rottime, h2rottime : real);
  16. begin
  17.      face.Init('clkface.3d');
  18.      face.Set_Reference_Point(0,0,0);
  19.      face.RotateZ(-90);
  20.      hand1.Init('clkhand.3d');
  21.      hand1.Set_Reference_Point(0,0,0);
  22.      hand1.Translate(0.5,0,0);
  23.      hand1.RotateX((round(graphics_time^) mod round (h1rottime))*(-360/h1rottime));
  24.      hand2.Init('clkhand.3d');
  25.      hand2.Set_Reference_Point(0,0,0);
  26.      hand2.Scale(1,1,0.8);
  27.      hand2.Translate(0.5,0,0);
  28.      hand2.RotateX((round(graphics_time^) mod round (h2rottime))*(-360/h2rottime));
  29.      face.AddChild(@hand1);
  30.      face.AddChild(@hand2);
  31.      face.MoveTo(x1,y1,z1);
  32.      hand1.Timed_RotateX_At(-360/h1rottime,now,infinity);
  33.      hand2.Timed_RotateX_At(-360/h2rottime,now,infinity);
  34. end;
  35.  
  36. end.