// include("Data/Scenes/guy.snf");

include("camera.snf");

box_path = "../Models/cube.obj";
quad_path = "../Models/quad.obj";
box = Model(box_path);
quad_geometry = Model(quad_path);

// m0 = Model("../Models/bigguy_00.obj");
// m1 = Model("../Models/bigguy_01.obj");
// m2 = Model("../Models/bigguy_02.obj");
i = 0;

kNumberOfGeometries = 21;

anim_node = Group();
anim_geo = ();
build_anim(anim_node, anim_geo);


def build_anim(node, geo) {
/*  m0 = Model("../Models/bigguy_00.obj");
  m1 = Model("../Models/bigguy_01.obj");
  m2 = Model("../Models/bigguy_02.obj");
  
  node.add(m0);
  node.add(m1);
  node.add(m2);
  geo.add(m0);
  geo.add(m1);
  geo.add(m2);
  */
  
  for (k = 0; k < kNumberOfGeometries; ++k) {
    m = Model("../Models/bigguy_" + STRING(k / 10) + STRING(k % 10) + ".obj");
	node.add(m);
	geo.add(m);
  }
  
}

scene = 
	Group(
		Group(
			// m0, m1, m2
			anim_node
		),
		Group(
			translate(0, -0.5, 0),
			rotate(-90, 1, 0, 0),
			scale(4, 4, 4),
			quad_geometry
		),
		Group(
			translate(1, -0.25, 0),
			scale(0.5, 0.5, 0.5),
			box
		),
		Group(
			translate(1, 4, 4),
			Light()
		)
	);

camera = Camera();
camera.setActive();
camera.setPos(0, 0.5, 2);

def f() {
 for (k = 0; k < anim_node.size(); ++k) {
  anim_geo.get(k).draw(false);
 }

 //m0.draw(false);
 //m1.draw(false);
 //m2.draw(false);
 // print(i);
 //if (i == 0)  m0.draw(true);
 //else if (i == 1) m1.draw(true);
 //else if (i == 2) m2.draw(true);
 
  anim_geo.get(i).draw(true);
 
 i = (i + 1) % kNumberOfGeometries;
}

Timer(50, -1, f(), f());
