====== Texture patterns and look up table ====== ===== Pattern: Waves ===== {{http://hyperfun.org/HF2/Language/Library/Attri_Lib/images/hfA_wave.JPG?200x200&nolink}}\\ **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**: [[http://hyperfun.org/HF2/Language/Library/Attri_Lib/hffiles/hfA_Wave.hf|hfA_Wave.hf]] ===== Pattern: CheckerBoard ===== {{http://hyperfun.org/HF2/Language/Library/Attri_Lib/images/hfA_CheckerBoard.JPG?200x200&nolink}}\\ **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**: [[http://hyperfun.org/HF2/Language/Library/Attri_Lib/hffiles/hfA_CheckerBoard.hf|hfA_CheckerBoard.hf]] ===== Pattern: Crackles ===== {{http://hyperfun.org/HF2/Language/Library/Attri_Lib/images/hfA_crackles.JPG?200x200&nolink}}\\ **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**: [[http://hyperfun.org/HF2/Language/Library/Attri_Lib/hffiles/hfA_Crackles.hf|hfA_Crackles.hf]] ===== Pattern: Concentric Circles (centered around the origin) ===== {{http://hyperfun.org/newFrep/HF/Language/Library/Attri_Lib/images/hfA_circles.JPG?200x200&nolink}}\\ **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**: [[http://hyperfun.org/HF2/Language/Library/Attri_Lib/hffiles/hfA_Circles.hf|hfA_Circles.hf]] ===== Look up table ===== {{http://hyperfun.org/HF2/Language/Library/Attri_Lib/images/hfA_LookUpTable.JPG?200x200&nolink}}\\ **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**: [[http://hyperfun.org/HF2/Language/Library/Attri_Lib/hffiles/hfA_LookUpTable.hf|hfA_LookUpTable.hf]] ===== Smooth Look up table ===== {{http://hyperfun.org/newFrep/HF/Language/Library/Attri_Lib/images/hfA_SmoothLookUpTable.JPG?200x200&nolink}}\\ **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**: [[http://hyperfun.org/HF2/Language/Library/Attri_Lib/hffiles/hfA_SmoothLookUpTable.hf|hfA_SmoothLookUpTable.hf]]