From 9b40029e42f994aeff59ecc44a6d3b8fba93071d Mon Sep 17 00:00:00 2001 From: Julian T Date: Fri, 21 Feb 2020 14:42:42 +0100 Subject: Pretty realistic colors --- scene.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scene.h') diff --git a/scene.h b/scene.h index 1c6363b..7efb5cd 100644 --- a/scene.h +++ b/scene.h @@ -23,16 +23,23 @@ typedef struct { typedef struct light_s{ vector_t *pos; - color_t *col; + color_t *defuse; struct light_s *next; } light_t; +typedef struct { + vector_t color; +} material_t; + // General object structure typedef struct object_s{ uint8_t type; struct object_s *next; + // Color and light information + material_t *m; + union { sphere_t sph; plane_t pl; @@ -45,8 +52,10 @@ typedef struct { light_t *lights; } space_t; -object_t *add_sphere(space_t *s, vector_t *c, COORD_T r); +object_t *add_sphere(space_t *s, vector_t *c, COORD_T r, material_t *m); object_t *add_plane(space_t *s, vector_t *start, vector_t *dir); -light_t *add_light(space_t *s, vector_t *pos, color_t *c); +light_t *add_light(space_t *s, vector_t *pos, color_t *defuse); + +void obj_norm_at(object_t *o, vector_t *dest, vector_t *point); #endif -- cgit v1.2.3