void App::create_scene(CL_GraphicContext &gc) { std::vector<CL_Collada_Image> library_images; Model model_cone("../SpotLight/Resources/cone.dae", library_images); Model model_teapot("../Clan3D/Resources/teapot.dae", library_images); camera = new SceneObject(scene, scene.base); camera->position = CL_Vec3f(-20.0f, 40.0f, -60.0f); camera->rotation_x = CL_Angle(20.0f, cl_degrees); light_distant = new SceneObject(scene, scene.base); light_distant->model = model_cone; light_distant->position = CL_Vec3f(0.0f, 32.0f, 20.0f); // Note, these are updated by the options light_distant->rotation_y = CL_Angle(45.0f, cl_degrees); light_distant->rotation_x = CL_Angle(35.0f, cl_degrees); teapot = new SceneObject(scene, scene.base); teapot->model = model_teapot; teapot->position = CL_Vec3f(-2.5f, 0.0f, 20.0f); teapot->scale = CL_Vec3f(50.0f, 50.0f, 50.0f); scene.gs->LoadImages(gc, library_images); }
void App::create_scene(CL_GraphicContext &gc) { Model model_teapot(gc, "../Clan3D/Resources/teapot.dae", true); Model model_landscape(gc, "Resources/land.dae", false); Model model_tree(gc, "Resources/tree.dae", false); Model model_gear(gc, "../Clan3D/Resources/gear.dae", false); model_teapot.SetMaterial( 32.0f, // shininess CL_Vec4f(0.0f, 0.0f, 0.0f, 1.0f), // emission CL_Vec4f(1.5f, 1.5f, 0.5f, 1.0f), // ambient CL_Vec4f(0.5f, 0.5f, 0.5f, 1.0f) ); // specular camera = new SceneObject(scene, scene.base); camera->position = CL_Vec3f(0.0f, 50.0f, -20.0f); camera->rotation_y = CL_Angle(0.0f, cl_degrees); camera->scale = CL_Vec3f(1.0f, 1.0f, 1.0f); light = new SceneObject(scene, scene.base); light->position = CL_Vec3f(-20.4732f, 48.7872f, -20.5439f); light->rotation_y = CL_Angle(45.0f, cl_degrees); light->rotation_x = CL_Angle(35.0f, cl_degrees); light->scale = CL_Vec3f(1.0f, 1.0f, 1.0f); SceneObject *object_landscape = new SceneObject(scene, scene.base); object_landscape->model = model_landscape; object_landscape->position = CL_Vec3f(0.0f, 0.0f, 0.0f); object_teapot1 = new SceneObject(scene, object_landscape); object_teapot1->model = model_teapot; object_teapot1->position = CL_Vec3f(-8.2f, 37.3f, 8.0f); object_teapot1->scale = CL_Vec3f(8.0f, 8.0f, 8.0f); object_teapot2 = new SceneObject(scene, object_landscape); object_teapot2->model = model_teapot; object_teapot2->position = CL_Vec3f(2.0f, 40.0f, 1.0f); object_teapot2->scale = CL_Vec3f(8.0f, 8.0f, 8.0f); SceneObject *object_tree = new SceneObject(scene, object_landscape); object_tree->model = model_tree; object_tree->position = CL_Vec3f(-7.2701f, 25.58f, -9.0932f); object_tree = new SceneObject(scene, object_landscape); object_tree->model = model_tree; object_tree->position = CL_Vec3f(-11.829f, 25.8125f, 0.0f); object_tree = new SceneObject(scene, object_landscape); object_tree->model = model_tree; object_tree->position = CL_Vec3f(-5.0f, 27.6963f, 0.0f); object_tree = new SceneObject(scene, object_landscape); object_tree->model = model_tree; object_tree->position = CL_Vec3f(0.0f, 29.4237f, 0.0f); object_gear = new SceneObject(scene, object_landscape); object_gear->model = model_gear; object_gear->position = CL_Vec3f(10.0f, 40.58f, 10.0); object_gear->scale = CL_Vec3f(3.0f, 3.0f, 3.0f); scene.gs->LoadImages(gc); }