@@ -397,18 +397,6 @@ function vtkCamera(publicAPI, model) {
397397
398398 mat4 . scale ( result , result , tmpvec1 ) ;
399399 mat4 . translate ( result , result , model . physicalTranslation ) ;
400-
401- // let rot = mat4.identity(new Float64Array(16));
402- //mat4.fromRotation(rot, model.physicalYawAngle / 180 * 3.14, model.physicalViewUp);
403- //// mat4.invert(rot, rot);
404- //mat4.mul(result, rot, result);
405-
406- //let tmpRot = mat4.identity(new Float64Array(16));
407- //let matInv = mat4.identity(new Float64Array(16));
408- //mat4.rotateY(tmpRot, tmpRot, model.physicalYawAngle / 180 * 3.14);
409- //mat4.transpose(tmpRot, tmpRot);
410- //mat4.invert(matInv, )
411- // mat4.mul(result, tmpRot, result);
412400 } ;
413401
414402 publicAPI . applyPhysicalYaw = ( angle ) => {
@@ -435,30 +423,6 @@ function vtkCamera(publicAPI, model) {
435423 viewToWorldPos [ 2 ] = v2wMatrix [ 14 ] ;
436424 viewToWorldPos [ 3 ] = 1 ;
437425 mat4 . copy ( tmpMatrix , v2wMatrix ) ;
438- //console.log('View -> World');
439- //console.log(v2wMatrix);
440- //mat4.copy(tmpMatrix, vmat);
441- //v[0] = tmpMatrix[12]; //tmpMatrix[12] = 0;
442- //tmpMatrix[13] = 0;
443- //tmpMatrix[14] = 0;
444- //mat4.invert(tmpMatrix, tmpMatrix);
445-
446- ////
447- ////
448- //// mat4.invert(tmpMatrix, tmpMatrix);
449- //// mat4.rotateY(tmpMatrix, tmpMatrix, model.physicalYawAngle / 180 * 3.14);
450- //// mat4.translate(tmpMatrix, tmpMatrix, [-v[0], -v[1], -v[2]]);
451-
452- ////// Correct center of rotation, incorrect view translation
453- ////mat4.invert(tmpMatrix, tmpMatrix);
454- ////mat4.rotateY(tmpMatrix, tmpMatrix, model.physicalYawAngle / 180 * 3.14);
455-
456- //// Correct view translation, incorrect center of rotation
457- //// mat4.invert(tmpMatrix, tmpMatrix););
458- ////let tmp = mat4.identity(new Float64Array(16));
459- ////tmpMatrix[12] = 0;
460- ////tmpMatrix[14] = 0;
461- //mat4.invert(tmpMatrix, tmpMatrix);
462426
463427 let w2vTranslate = mat4 . identity ( new Float64Array ( 16 ) ) ;
464428 let rotate = mat4 . identity ( new Float64Array ( 16 ) ) ;
@@ -486,35 +450,9 @@ function vtkCamera(publicAPI, model) {
486450 ] ) ;
487451 mat4 . translate ( w2vTranslateReverse , w2vTranslateReverse , worldToViewPos ) ;
488452
489- //mat4.mul(tmpMatrix, w2vTranslate, vmat);
490- //mat4.mul(tmpMatrix, rotate, tmpMatrix);
491- //mat4.mul(tmpMatrix, w2vTranslateReverse, tmpMatrix);
492- //mat4.invert(tmpMatrix, tmpMatrix);
493-
494- // FIXME works post-snap? mat4.mul(v2wTranslateReverse, v2wTranslate, rotate);
495- // mat4.mul(v2wTranslate, v2wTranslate, rotate);
496- //mat4.mul(v2wTranslateReverse, v2wTranslateReverse, rotate);
497- mat4 . mul ( v2wTranslateReverse , v2wTranslate , rotate ) ;
498- mat4 . mul ( tmpMatrix , v2wTranslateReverse , v2wMatrix ) ;
453+ mat4 . mul ( tmpMatrix , v2wTranslate , v2wMatrix ) ;
499454 mat4 . mul ( tmpMatrix , tmpMatrix , rotate ) ;
500- mat4 . mul ( tmpMatrix , v2wTranslate , tmpMatrix ) ;
501-
502- //mat4.rotateY(tmpMatrix, tmpMatrix, -1 * model.physicalYawAngle / 180 * 3.14);
503- //mat4.translate(tmpMatrix, tmpMatrix, [0, 0, 0.01 * model.physicalYawAngle]);
504- //mat4.translate(tmpMatrix, tmpMatrix, v);
505- //mat4.invert(tmpMatrix, tmpMatrix);
506- ////
507- //mat4.invert(tmpMatrix, tmpMatrix);
508- //tmpMatrix[12] = v[0];
509- //tmpMatrix[13] = v[1];
510- //tmpMatrix[14] = v[2];
511-
512- // FIXME try pushing through the cone position at <0,0,-1>
513- //v[0] = 0;
514- //v[1] = 0;
515- //v[1] = -1;
516- //vec3.transformMat4(tmpvec1, v, tmpMatrix);
517- // console.log(v);
455+ mat4 . mul ( tmpMatrix , v2wTranslateReverse , tmpMatrix ) ;
518456
519457 // note with glmatrix operations happen in
520458 // the reverse order
0 commit comments