diff options
author | Julian T <julian@jtle.dk> | 2020-02-21 14:42:42 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-02-21 14:42:42 +0100 |
commit | 9b40029e42f994aeff59ecc44a6d3b8fba93071d (patch) | |
tree | c133f8f6190b445560c4d8438ba89d7caaa0a7cd /scene.h | |
parent | 623fee395425ab33f14fb9cd8ffa790e362f59d7 (diff) |
Pretty realistic colors
Diffstat (limited to 'scene.h')
-rw-r--r-- | scene.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 |