Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Example slowing down... (OpenGL/lablgl)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-13 (00:30)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] Example slowing down... (OpenGL/lablgl)
On Thu, 12 Apr 2007, Jon Harrop wrote:

> On Thursday 12 April 2007 21:26, Martin wrote:
> > No, it seems to be related to the matrix accumulating numerical errors.
> No. It is the time function.
> You can check the numerical error by computing the determinant, which remains
> accurate to 1 part in 10^5 after 3600 frames. The mean numerical error
> probably scales as sqrt n because the floats are "random".

Actually it's just that the angle is not only a function of time, but also
of the period T between two frames:

  angle(t+T) = angle(t) + 0.01 * t

For example, if you interrupt the program and restart it a few seconds
later, the rotation will restart where it left (plus one tiny increment)
even though time is still running.

So there's probably no big trouble with the time function or the
rotation matrix.


Martin Jambon