@@ -34,7 +34,8 @@ const controls = {
34
34
'HighTriRange' : 1.0 ,
35
35
'HeightT' : 'Off' ,
36
36
'SymbolScaleT' : 'Off' ,
37
- 'SymbolPositionT' : 'Off'
37
+ 'SymbolPositionT' : 'Off' ,
38
+ 'NumSymbolsPerTri' : 1.0 ,
38
39
39
40
} ;
40
41
@@ -92,6 +93,7 @@ function main() {
92
93
f1 . add ( controls , 'HeightT' , [ 'On' , 'Off' ] ) ;
93
94
f1 . add ( controls , 'SymbolScaleT' , [ 'On' , 'Off' ] ) ;
94
95
f1 . add ( controls , 'SymbolPositionT' , [ 'On' , 'Off' ] ) ;
96
+ f1 . add ( controls , 'NumSymbolsPerTri' , 0.0 , 10.0 ) . step ( 1.0 ) ;
95
97
96
98
var f2 = gui . addFolder ( 'Animation' ) ;
97
99
@@ -137,13 +139,21 @@ function main() {
137
139
sdf . setDimensions ( window . innerWidth , window . innerHeight ) ;
138
140
139
141
time = 0 ;
142
+
143
+ let SymbolPositionT = 0 ;
144
+ let SymbolScaleT = 0 ;
145
+ let HeightT = 0 ;
140
146
// This function will be called every frame
141
147
function tick ( ) {
142
148
time += 1 ;
143
149
color = vec4 . fromValues ( controls . Color [ 0 ] / 255 , controls . Color [ 1 ] / 255 , controls . Color [ 2 ] / 255 , 1 ) ;
144
150
noiseColor = vec4 . fromValues ( controls [ 'Noise Color' ] [ 0 ] / 255 , controls [ 'Noise Color' ] [ 1 ] / 255 , controls [ 'Noise Color' ] [ 2 ] / 255 , 1 ) ;
145
151
height = controls [ 'Depth' ] ;
146
152
153
+ if ( controls [ 'SymbolScaleT' ] == 'On' ) { SymbolScaleT += 0.01 }
154
+ if ( controls [ 'SymbolPositionT' ] == 'On' ) { SymbolPositionT += 0.01 }
155
+ if ( controls [ 'HeightT' ] == 'On' ) { HeightT += 0.01 }
156
+
147
157
if ( controls [ 'Camera Animation' ] == 'On' ) {
148
158
// camera.setPosition(vec3.fromValues(
149
159
// controls['CameraX'] + Math.sin(timeCamera) * 4,
@@ -167,13 +177,16 @@ function main() {
167
177
icosphere . create ( ) ;
168
178
}
169
179
180
+
181
+
170
182
sdf . setRows ( controls [ 'Rows' ] ) ;
171
183
sdf . setTriScale ( controls [ 'TriScale' ] ) ;
172
184
sdf . setLowTriRange ( controls [ 'LowTriRange' ] ) ;
173
185
sdf . setHighTriRange ( controls [ 'HighTriRange' ] ) ;
174
- sdf . setHightT ( controls [ 'HeightT' ] == 'On' ? 1.0 : 0.0 ) ;
175
- sdf . setSymbolScaleT ( controls [ 'SymbolScaleT' ] == 'On' ? 1.0 : 0.0 ) ;
176
- sdf . setSymbolPositionT ( controls [ 'SymbolPositionT' ] == 'On' ? 1.0 : 0.0 ) ;
186
+ sdf . setHightT ( HeightT ) ;
187
+ sdf . setSymbolScaleT ( SymbolScaleT ) ;
188
+ sdf . setSymbolPositionT ( SymbolPositionT ) ;
189
+ //sdf.setNumSymbolsPerTri(controls['NumSymbolsPerTri']);
177
190
178
191
renderer . render ( camera , time , height , color , noiseColor , sdf , [
179
192
square ,
0 commit comments