void setup_scene_4() { theCamera = init_camera(vector_init(2, 1, 3), vector_init(0, 0.3, 0), vector_init(0, 1, 0), 60, (float) WIDTH / (float) HEIGHT); lights[0].position = vector_init(0, 1.7, 1); lights[0].col = vector_init(1, 1, 1); lights[1].position = vector_init(3, 2, 3); lights[1].col = vector_init(0.4, 0.4, 0.4); lights[2].position = vector_init(4, 3, -1); lights[2].col = vector_init(0.5, 0.5, 0.5); num_lights = 3; object_count = 0; material mat; mat.kd = vector_init(.5, .5, .5); mat.ks = vector_init(.5, .5, .5); mat.shininess = 200; mat.reflect_coef = 0.4; scene[object_count++] = init_sphere(0, 0, 0, .3, mat); mat.kd = vector_init(.9, 0, 0); mat.ks = vector_init(.1, .1, .1); mat.shininess = 500; scene[object_count++] = init_sphere(1, -.05, 0, .15, mat); mat.kd = vector_init(0, 1, 0); mat.ks = vector_init(.0, .0, .0); mat.shininess = 0.01; mat.reflect_coef = 0.04; scene[object_count++] = init_sphere(0, 1, 0, .25, mat); mat.kd = vector_init(0, 0, 0.6); mat.ks = vector_init(.4, .4, .4); mat.shininess = 20; scene[object_count++] = init_sphere(0, -.05, 1, .20, mat); mat.kd = vector_init(.5, 0.9, .7); mat.ks = vector_init(.01, .01, .01); mat.shininess = 100; mat.reflect_coef = 0.04; scene[object_count++] = init_plane(0, 1, 0, 0.2, mat); mat.kd = vector_init(.8, 0.09, .07); mat.ks = vector_init(.2, .2, .1); mat.shininess = 10; mat.reflect_coef = 0.5; scene[object_count++] = init_plane(1, 0.0, -1.0, 2, mat); mat.kd = vector_init(0.1, 0.3, .05); mat.ks = vector_init(.5, .5, .5); mat.shininess = 20; scene[object_count++] = init_plane(0.3, -0.2, 1, 3, mat); }
void init_scene(t_scene **scene) { t_coord coord; t_vec3 v; init_coord(&coord, 0, 0, -50); init_vec3(&v, 0, 0, 1); //init_plane(scene, coord, v, 0x0000FF); init_coord(&coord, 0, -3, 0); init_vec3(&v, 0, 1, 0); init_plane(scene, coord, v, 0x00FF66); init_coord(&coord, -5, 4, -21); init_circle(scene, coord, 0xFFFFFF, 4); init_coord(&coord, 0, 4, -21); init_circle(scene, coord, 0xFF0000, 2); init_coord(&coord, 5, 2, -25); init_vec3(&v, 0, 0, 1); init_cylinder(scene, coord, v, 2, 0x0000FF); init_coord(&coord, -10, -2, -25); init_vec3(&v, 0, 0, 1); init_cone(scene, coord, v, 0x00FFFF); }
void init_chip(struct nand_chip *p_chip) { int i; p_chip->status = 0; p_chip->current_access_mode = MLC_MODE; p_chip->cmd = IDLE; p_chip->planes = &nand_mem_pointer.plane[nand_mem_pointer.chips]; nand_mem_pointer.chips++; for (i = 0; i < PLANES_PER_CHIP; i++) { init_plane(&p_chip->planes[i]); } }
void setup_scene_2() { theCamera = init_camera(vector_init(2, 1, 3), vector_init(0, 0.3, 0), vector_init(0, 1, 0), 60, (float) WIDTH / (float) HEIGHT); lights[0].position = vector_init(-2, 1.7, 3); lights[0].col = vector_init(1, 1, 1); lights[1].position = vector_init(3, 2, 3); lights[1].col = vector_init(0.4, 0.4, 0.4); lights[2].position = vector_init(4, 3, -10); lights[2].col = vector_init(0.5, 0.5, 0.5); num_lights = 3; object_count = 0; material mat; mat.shininess = 20; mat.kd = vector_init(1, 1, 1); mat.ks = vector_init(.5, .5, .5); mat.reflect_coef = 0.8; scene[object_count++] = init_sphere(0, 0, 0, .3, mat); mat.reflect_coef = 0.5; mat.shininess = 20; mat.kd = vector_init(0, 0, 1); scene[object_count++] = init_sphere(0, -.05, 1, .20, mat); mat.reflect_coef = 0.04; mat.ks = vector_init(.1, .1, .1); mat.kd = vector_init(0, 1, 0); scene[object_count++] = init_sphere(0, 1, 0, .15, mat); mat.kd = vector_init(1, 0, 0); mat.shininess = 500; scene[object_count++] = init_sphere(1, -.05, 0, .15, mat); mat.kd = vector_init(.5, 1, .7); scene[object_count++] = init_plane(0, 1, 0, 0.2, mat); mat.reflect_coef = 0.0; mat.ks = vector_init(.1, .1, .1); mat.kd = vector_init(1, 1, 0); scene[object_count++] = init_cylinder(vector_init(.0, .0, .0), vector_init(1, 0, 0), 1, .05, mat); scene[object_count++] = init_cylinder(vector_init(.0, .0, .0), vector_init(0, 1, 0), 1, .05, mat); scene[object_count++] = init_cylinder(vector_init(.0, .0, .0), vector_init(0, 0, 1), 1, .05, mat); }
void init_dcpred(M4V_DCPRED* pred) { init_plane(pred, 0); init_plane(pred, 4); init_plane(pred, 5); }