From 550acac3992f5b5aa2d162ed215ddd3359588450 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 4 Dec 2009 15:31:43 +0100 Subject: Fix rotation group sampling. D'oh. --- src/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.c b/src/utils.c index f27b1228..5942299d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -122,10 +122,10 @@ struct quaternion random_quaternion() { struct quaternion q; - q.w = (double)random()/RAND_MAX; - q.x = (double)random()/RAND_MAX; - q.y = (double)random()/RAND_MAX; - q.z = (double)random()/RAND_MAX; + q.w = 2.0*(double)random()/RAND_MAX - 1.0; + q.x = 2.0*(double)random()/RAND_MAX - 1.0; + q.y = 2.0*(double)random()/RAND_MAX - 1.0; + q.z = 2.0*(double)random()/RAND_MAX - 1.0; q = normalise_quaternion(q); return q; -- cgit v1.2.3