finished LightBounce box, need to use common LogoBox object and add display list functionality to LightBounceBox class
git-svn-id: svn://anubis/dwscr/trunk@96 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
parent
2b43b1c10f
commit
f392674730
@ -13,7 +13,7 @@ using namespace std;
|
||||
|
||||
#define SIZE 5
|
||||
#define STRIDE_MULTIPLIER 1.0;
|
||||
#define ZOOM 14.0
|
||||
#define ZOOM 12.0
|
||||
|
||||
LightBounceBox::LightBounceBox(LogoBox * lb,
|
||||
float x, float y, float z,
|
||||
@ -57,22 +57,36 @@ LightBounce::LightBounce(SSMain * _SSMain) : SSMode(_SSMain)
|
||||
float x = -half_size + box_stride / 2.0;
|
||||
for (int j = 0; j < SIZE; j++)
|
||||
{
|
||||
// front
|
||||
LightBounceBox * box = new LightBounceBox(
|
||||
new LogoBox(), x, y, -half_size, 0, 0, rot ? 90.0 : 0
|
||||
new LogoBox(), x, y, -half_size, 0, 180.0, rot ? 90.0 : 0
|
||||
);
|
||||
m_boxes.push_back(box);
|
||||
// right
|
||||
box = new LightBounceBox(
|
||||
new LogoBox(), half_size, y, x, 0, 90.0, rot ? 0 : 90.0
|
||||
);
|
||||
m_boxes.push_back(box);
|
||||
// back
|
||||
box = new LightBounceBox(
|
||||
new LogoBox(), x, y, half_size, 0, 180.0, rot ? 90.0 : 0
|
||||
new LogoBox(), x, y, half_size, 0, 0, rot ? 90.0 : 0
|
||||
);
|
||||
m_boxes.push_back(box);
|
||||
// left
|
||||
box = new LightBounceBox(
|
||||
new LogoBox(), -half_size, y, x, 0, 270.0, rot ? 0 : 90.0
|
||||
);
|
||||
m_boxes.push_back(box);
|
||||
// top
|
||||
box = new LightBounceBox(
|
||||
new LogoBox(), x, half_size, y, 270, 0, rot ? 0 : 90.0
|
||||
);
|
||||
m_boxes.push_back(box);
|
||||
// bottom
|
||||
box = new LightBounceBox(
|
||||
new LogoBox(), x, -half_size, y, 90, 0, rot ? 0 : 90.0
|
||||
);
|
||||
m_boxes.push_back(box);
|
||||
|
||||
rot = !rot;
|
||||
x += box_stride;
|
||||
@ -93,8 +107,8 @@ void LightBounce::update()
|
||||
{
|
||||
glViewport(i*width/numMonitors, 0, width/numMonitors, height);
|
||||
glLoadIdentity();
|
||||
gluLookAt(0, 0, SIZE * ZOOM, 0, 0, 0, 0, 1, 0);
|
||||
glRotatef(m_elapsed/33.0f, 0, 1, 0);
|
||||
gluLookAt(0, SIZE * ZOOM * 2.0 / 3.0, SIZE * ZOOM, 0, 0, 0, 0, 1, 0);
|
||||
glRotatef(m_elapsed/66.0f, 0, 1, 0);
|
||||
int sz = m_boxes.size();
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user