void set_defaults(t_session *s)
{
+ t_camera cam;
+ t_light light;
+ t_object plane;
+
s->img.width = 1920;
s->img.height = 1011;
+ ft_vec_init(&s->scene.objects, sizeof(t_object));
+ ft_vec_init(&s->scene.lights, sizeof(t_light));
+ ft_vec_init(&s->scene.cameras, sizeof(t_camera));
+ light.color.x = 1;
+ light.color.y = 1;
+ light.color.z = 1;
+ light.position.x = 0;
+ light.position.y = 0;
+ light.position.z = 1;
+ light.brightness = 0.5;
+ ft_vec_append(&s->scene.lights, &light);
+ cam.position.x = 0;
+ cam.position.y = 0;
+ cam.position.z = 0;
+ cam.orientation.x = 1;
+ cam.orientation.y = 0;
+ cam.orientation.z = 0;
+ cam.up_direction.x = 0;
+ cam.up_direction.y = 0;
+ cam.up_direction.z = 1;
+ cam.field_of_view = 1.5;
+ ft_vec_append(&s->scene.cameras, &cam);
+ plane.object.sphere.color.x = 1;
+ plane.object.sphere.color.y = 0;
+ plane.object.sphere.color.z = 0;
+ plane.object.sphere.center.x = 1;
+ plane.object.sphere.center.y = 0;
+ plane.object.sphere.center.z = 0;
+ plane.object.sphere.radius = 0.3;
+ plane.type = SPHERE;
+ ft_vec_append(&s->scene.objects, &plane);
+ s->scene.current_camera = ft_vec_caccess(&s->scene.cameras, 0);
+ s->scene.ambient_light.color.x = 1;
+ s->scene.ambient_light.color.y = 0;
+ s->scene.ambient_light.color.z = 0;
+ s->scene.ambient_light.brightness = 0.3;
}
int main(void)