POV-Ray : Newsgroups : povray.beta-test : Clock precision wrong? : Clock precision wrong? Server Time
9 Jun 2024 06:49:43 EDT (-0400)
  Clock precision wrong?  
From: ErOssel
Date: 25 Jun 2011 16:30:00
Message: <web.4e0643e23414175bd091e86b0@news.povray.org>
Hi folks,

I noticed a not correct value for clock in animation.

Test with version 3.7.0.RC3.msvc9.win64 running on Windows 7 (64bit).

ini-script:
Input_File_Name="clock_precision.pov"
Initial_Frame=1
Final_Frame=30
Cyclic_Animation=on
Subset_Start_Frame = 21
Subset_End_Frame   = 21

Input_File_Name clock_precision.pov:
#version 3.7;
global_settings {  assumed_gamma 1.0 }
camera {location <0,0,-1> look_at 0}
light_source {1500 color rgb<1,1,1>}
sky_sphere {pigment {color rgb<1,1,1>}}
#if (final_frame=0) // IMHO: The precision of clock on 64 bit system or version
3.7  is not correct
  #declare g_Clock=0;
#else
  #declare g_Clock=(frame_number-1)/(final_frame-initial_frame); // = clock ???
#end
#include "screen.inc"
Screen_Object(text{ttf "COURBD.TTF" concat( "initial_frame: "   ,
str(initial_frame, 4,0)) 0.1 0 pigment{color 0} scale .08},<0.01,1-0.1*1>,0,0,1)
Screen_Object(text{ttf "COURBD.TTF" concat( "final_frame  : "   ,
str(final_frame  , 4,0)) 0.1 0 pigment{color 0} scale .08},<0.01,1-0.1*2>,0,0,1)
Screen_Object(text{ttf "COURBD.TTF" concat( "frame_number : "   ,
str(frame_number , 4,0)) 0.1 0 pigment{color 0} scale .08},<0.01,1-0.1*3>,0,0,1)
Screen_Object(text{ttf "COURBD.TTF" concat( "clock        : "   , str(clock
  ,12,9)) 0.1 0 pigment{color 0} scale .08},<0.01,1-0.1*5>,0,0,1)
Screen_Object(text{ttf "COURBD.TTF" concat( "g_Clock      : "   , str(g_Clock
  ,12,9)) 0.1 0 pigment{color 0} scale .08},<0.01,1-0.1*6>,0,0,1)
#debug concat( "frame_number: ", str(frame_number,4,0)," clock: ",
str(clock,12,9)," g_Clock: ", str(g_Clock,12,9),"\n")

Result: frame_number:   21 clock:  0.666666687 g_Clock:  0.666666667
There is a difference of 0.66666662
And I noticed a bigger difference with a larger amount of frames.

I just liked to mention this behaviour and may be I am overlooking something.

Regards, ErO


Post a reply to this message

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