miniRT
By Marcelo Magalhães and Ygor G. Sena, 2023.
s_pattern Struct Reference

The type t_pattern contatins all the necessary information to apply a texture on a given shape's surface. More...

#include <patterns.h>

Collaboration diagram for s_pattern:

Data Fields

t_bool has_pattern
 
t_pttr_at pattern_at
 
t_text_map texture_map
 
t_color a
 
t_color b
 
t_matrix transform
 
t_matrix inverse
 
t_matrix transpose
 

Detailed Description

The type t_pattern contatins all the necessary information to apply a texture on a given shape's surface.

Parameters
has_patternStores TRUE if shape has a pattern or FALSE, if not.
pattern_atReceives a pattern function to apply the corresponding pattern. For more information, see t_pttr_at description.
texture_mapThis structure creates a t_pattern subclass (the same as t_pttr_at, which calls stripe_at() or checkered_at()). t_text_map is a subclass that uses spherical_map(), planar_map() or cylindrical_map() to define how to apply a pattern on a given 2D or 3D shape's surface.
widthReceives u, the horizontal value of checkers squares.
heightReceives v, the vertical value of checkers squares.
aReceives the first color of a given pattern to be applied.
bReceives the second color of a given pattern to be applied.
transformStores matrix transformation so that pattern be manipulated.