miniRT
By Marcelo Magalhães and Ygor G. Sena, 2023.
materials.h
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* materials.h :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: yde-goes <yde-goes@student.42sp.org.br> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2023/04/11 11:05:52 by yde-goes #+# #+# */
9 /* Updated: 2023/06/16 13:40:04 by yde-goes ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
14 #ifndef MATERIALS_H
15 # define MATERIALS_H
16 
17 # include "lights.h"
18 # include "patterns.h"
19 
42 typedef struct s_material
43 {
44  t_color color;
45  t_color ambient;
46  float diffuse;
47  float specular;
48  float shininess;
49  t_pattern pattern;
51 
52 /* ************************************************************************** */
53 /* MATERIALS.C */
54 /* ************************************************************************** */
55 
73 typedef struct s_exposure
74 {
75  t_color effective_color;
76  t_vector lightv;
77  t_vector reflectv;
78  float light_dot_normal;
79  float reflect_dot_eye;
80  float factor;
82 
91 t_material material(void);
92 
93 #endif
t_material material(void)
The function material() instances a new material of struct type t_material with the following default...
Definition: materials.c:20
struct s_material t_material
A material has a surface color and four attributes from the Phong Reflection Model: ambient,...
struct s_exposure t_exposure
The struct s_exposure contains the necessary fields to calculate the a scene's lighting....
The struct s_color stores the color values of ray tracing. It contains a field for red,...
Definition: tuples.h:63
The struct s_exposure contains the necessary fields to calculate the a scene's lighting....
Definition: materials.h:74
A material has a surface color and four attributes from the Phong Reflection Model: ambient,...
Definition: materials.h:43
The type t_pattern contatins all the necessary information to apply a texture on a given shape's surf...
Definition: patterns.h:123
Tuple means a list of ordered things. The struct t_tuple stores coordinates for a left-handed coordin...
Definition: tuples.h:33