File tree 2 files changed +35
-2
lines changed
2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,28 @@ var Grid = {
14
14
to : 42 ,
15
15
step : 2
16
16
} ,
17
+
18
+ set_low : function ( ) {
19
+ x = { from :- 1 , to :1 , step :.1 } ;
20
+ y = { from :- 1 , to :1 , step :.1 } ;
21
+ z = { from :- 1 , to :1 , step :.1 } ;
22
+ }
23
+
17
24
} ;
25
+
26
+ //Grid.set_low();
27
+
28
+ //manual rotation
29
+ Rot = {
30
+ x : 4.2 ,
31
+ y : 6.1 ,
32
+ z : 0
33
+ }
34
+
35
+ //Manual translation
36
+ Trans = {
37
+ x : - 30 ,
38
+ y : - 30 ,
39
+ z : - 21
40
+
41
+ }
Original file line number Diff line number Diff line change @@ -183,6 +183,9 @@ function mapReduce() {
183
183
} ) ;
184
184
}
185
185
186
+
187
+
188
+
186
189
//called once all workers information has been aggregated
187
190
function render ( data ) {
188
191
var vertices = data . vertices ,
@@ -200,7 +203,7 @@ function render(data) {
200
203
fn = formData . fn ,
201
204
isolevel = formData . isolevel ;
202
205
203
-
206
+
204
207
//draw scene
205
208
gl . viewport ( 0 , 0 , gl . viewportWidth , gl . viewportHeight ) ;
206
209
gl . clear ( gl . COLOR_BUFFER_BIT | gl . DEPTH_BUFFER_BIT ) ;
@@ -211,10 +214,16 @@ function render(data) {
211
214
if ( formData . rotate ) {
212
215
rx += rdx ;
213
216
ry += rdy ;
217
+ //rx = Rot.x;
218
+ //ry = Rot.y;
214
219
}
215
220
216
- elMatrix . multiply ( THREE . Matrix4 . rotationXMatrix ( rx ) , THREE . Matrix4 . rotationYMatrix ( ry ) ) ;
221
+ // elMatrix.multiplySelf (THREE.Matrix4.translationMatrix(Rot.x,Rot.y,Rot.z ));
217
222
223
+ //elMatrix.multiplySelf(THREE.Matrix4.rotationXMatrix(rx))
224
+ //elMatrix.multiplySelf(THREE.Matrix4.rotationYMatrix(ry))
225
+ elMatrix . multiply ( THREE . Matrix4 . rotationXMatrix ( rx ) , THREE . Matrix4 . rotationYMatrix ( ry ) ) ;
226
+ elMatrix . multiplySelf ( THREE . Matrix4 . translationMatrix ( Trans . x , Trans . y , Trans . z ) ) ;
218
227
viewMatrix . multiply ( camera . matrix , elMatrix ) ;
219
228
220
229
//send matrices
You can’t perform that action at this time.
0 commit comments