User Tools

Site Tools


hyperfun:lib_atttex

Texture patterns and look up table

Pattern: Waves

hfa_wave.jpg
Definition: t = (1+sin(freq*xt))/2.0
attribute = a0+t*(a1-a0)

Call: hfA_Wave(xt,a0,a1,freq);

Parameters:
xt - point coordinate
a0,a1 - Interval in between the returned value belongs
freq - Frequency

Output : A value between [a0,a1]

Test file: hfA_Wave.hf

Pattern: CheckerBoard

hfa_checkerboard.jpg

Call: hfA_CheckerBoard(x,bricks,space,s, c_bricks,c_space);

Parameters:
x - point coordinates array
bricks - Size of the bricks. (3D : width,lenght,wide)
space - Size of the spaces between the bricks. (3D : width,lenght,wide)
s - Output Array
c_bricks - array of attributes corresponding to the bricks
c_space - array of attributes corresponding to the spaces

Output : attributes in the s array

Test file: hfA_CheckerBoard.hf

Pattern: Crackles

hfa_crackles.jpg

Definition : A “noisy” value p is calculated. According to the map array, attributes are applied.

Call: hfA_Crackles(x,s,freq, attributes,maps);

Parameters:
x - point coordinates array
s - Output Array. Size k
freq - frequency of the pattern
attributes - set of array of attributes. Size k(n-1)
maps - array of n+2 values :[0,a1,…an,1]

Output : attributes in the s array

Test file: hfA_Crackles.hf

Pattern: Concentric Circles (centered around the origin)

hfa_circles.jpg

Definition : Periodic circular areas are calculated, and attributes are set according to the map array.

Call: hfA_Circles(x,s , attributes,maps);

Parameters:
x - point coordinates array
s - Output Array. Size k
attributes - set of array of attributes. Size k(n-1)
maps - array of n+2 values :[0,a1,…an,1]

Output : attributes in the s array

Test file: hfA_Circles.hf

Look up table

hfa_lookuptable.jpg

Definition : Given a set of intervals (array of n values in [0,1]), and given a set of colors (array of 3*(n-1) values), each set corresponding to an interval, and given a value t in [0,1]. Depending on the interval t belongs to, a set of attributes is set.

Call: hfA_LookUpTable(t,s,c,map)

Parameters:
t - Real value
s - Output array (attributes)
c - Input array (attributes)
map - Input array (interval)

Output : attributes in the s array

Test file: hfA_LookUpTable.hf

Smooth Look up table

hfa_smoothlookuptable.jpg

Definition : Given a set of intervals (array of n values in [0,1]), and given a set of colors (array of 3*(n-1) values in the case of rgb attributes), each set corresponding to an interval, and given a value t in [0,1]. Depending on the interval t belongs to, a set of attributes is set. A linear interpolation is performed between the set of attributes corresponding to the lower and upper boundary of the interval where t belongs to.

Call: hfA_SmoothLookUpTable(t,s,c,map)

Parameters:
t - Real value
s - Output array (attributes)
c - Input array (attributes)
map - Input array (interval)

Output : attributes in the s array

Test file: hfA_SmoothLookUpTable.hf

hyperfun/lib_atttex.txt · Last modified: 2020/12/31 10:49 (external edit)