void setupScene(void) { camera.yaw = 0; camera.pitch = -15; camera.roll = 0; camera.fov = 90; camera.aspectRatio = 4. / 3.0; camera.position = Vector(0,165,0); camera.frameBegin(); lightPos = Vector(-90, 700, -350); lightIntensity = 800000; ambientLight = Color(0.2, 0.2, 0.2); Plane* plane = new Plane; Texture* texture = new BitmapTexture("data/floor.bmp", 200); CheckerTexture* checker = new CheckerTexture; checker->color1 = Color(1, 1, 1); checker->color2 = Color(0, 0, 0); checker->scaling = 7; Lambert* lambert = new Lambert; lambert->color = Color(1, 1, 1); lambert->texture = texture; nodes.push_back({plane, lambert}); const Uint32 colors[9] = { 0xff2222, 0xaa4444, 0x886666, 0x22ff22, 0x44aa44, 0x668866, 0x2222ff, 0x4444aa, 0x666688, }; for (int y = 0; y < 3; y++) for (int x = 0; x < 3; x++) { Vector center = Vector((x - 1) * 80, y * 80 + 25, 200); Sphere* s = new Sphere; s->O = center; s->R = 29 + 5 * x; Cube* c = new Cube; c->O = center + ((y == 2) ? Vector(0, 0, -35) : Vector(0, 0, 0)); c->halfSide = y == 2 ? 10 : 25; CsgOp* diff; switch (y) { case 0: diff = new CsgMinus; diff->left = c; diff->right = s; break; case 1: diff = new CsgAnd; diff->left = c; diff->right = s; break; case 2: diff = new CsgMinus; diff->left = s; diff->right = c; break; default: break; } Phong* phong = new Phong; phong->color = Color(colors[y * 3 + x]); phong->specularExponent = 60; phong->specularMultiplier = 1; phong->texture = NULL; nodes.push_back({diff, phong}); } }