From 6e86df5482f96d272bedd550ecdbe74bbd4406cf Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 13 Nov 2008 04:24:07 +0000 Subject: [PATCH] offset to center wall git-svn-id: svn://anubis/dwscr/trunk@93 5bef9df8-b654-44bb-925b-0ff18baa8f8c --- ss/LightBounce.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ss/LightBounce.cc b/ss/LightBounce.cc index 093d232..4733f0c 100644 --- a/ss/LightBounce.cc +++ b/ss/LightBounce.cc @@ -12,6 +12,8 @@ using namespace std; #define SIZE 5 +#define STRIDE_MULTIPLIER 1.0; +#define ZOOM 10.0 /* construct screensaver mode and do some basic OpenGL setup */ LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain) @@ -27,13 +29,13 @@ LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain) glMatrixMode(GL_MODELVIEW); LogoBox tmp; - float box_stride = tmp.getWidth() * 1.2; + float box_stride = tmp.getWidth() * STRIDE_MULTIPLIER; float half_size = SIZE * box_stride / 2.0; - float y = -half_size; + float y = -half_size + box_stride / 2.0; int rot = false; for (int i = 0; i < SIZE; i++) { - float x = -half_size; + float x = -half_size + box_stride / 2.0; for (int j = 0; j < SIZE; j++) { LightBounce_Box * box = new LightBounce_Box; @@ -64,7 +66,7 @@ void LightBounce::update() { glViewport(i*width/numMonitors, 0, width/numMonitors, height); glLoadIdentity(); - gluLookAt(0, 0, SIZE * 5.0, 0, 0, 0, 0, 1, 0); + gluLookAt(0, 0, SIZE * ZOOM, 0, 0, 0, 0, 1, 0); glRotatef(m_elapsed/33.0f, 0, 1, 0); int sz = m_boxes.size(); for (int i = 0; i < sz; i++)