Project

General

Profile

« Previous | Next » 

Revision a4d59c0b

Added by Leszek Koltunski over 5 years ago

Massive: make the coordinate system agree with that of OpenGL (i.e. invert the Y axis).

View differences:

src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
60 60
      {
61 61
      mView = v;
62 62

  
63
      Static3D pLeft = new Static3D( 90, 258, 0);
64
      Static3D pRight= new Static3D(176, 255, 0);
63
      // two points, centers of the Distort effect
64
      // the left and right tip of the mouth
65
      Static3D pLeft  = new Static3D( 90, 108, 0);
66
      Static3D pRight = new Static3D(176, 111, 0);
65 67

  
66
      Static4D rLeft = new Static4D(-10,-10, 0,25);
67
      Static4D rRight= new Static4D( 10, -5, 0,25);
68
      // two regions defining the areas affected by the Distort effect
69
      Static4D rLeft  = new Static4D(-10, 10, 0, 25);
70
      Static4D rRight = new Static4D( 10,  5, 0, 25);
71

  
72
      // two dynamics for interpolating through vectors of distortion. Interpolate
73
      // every 1000 miliseconds, indefinately ('0.0f').
68 74
      Dynamic3D dLeft = new Dynamic3D(1000,0.0f);
69 75
      Dynamic3D dRight= new Dynamic3D(1000,0.0f);
70
      dLeft.add ( new Static3D(  0,  0,0) );
71
      dLeft.add ( new Static3D(-20,-20,0) );
72
      dRight.add( new Static3D(  0,  0,0) );
73
      dRight.add( new Static3D( 20,-10,0) );
76

  
77
      // two vectors of distortion the left tip of the mouth gets distorted with -
78
      // interpolated from (0,0,0) - i.e. no distortion - to (-20,20,0), i.e.
79
      // slightly to the top left.
80
      dLeft.add ( new Static3D(  0,  0, 0) );
81
      dLeft.add ( new Static3D(-20, 20, 0) );
82

  
83
      // likewise two vectors the right tip is distorted with.
84
      dRight.add( new Static3D(  0,  0, 0) );
85
      dRight.add( new Static3D( 20, 10, 0) );
74 86

  
75 87
      mEffects = new DistortedEffects();
76 88
      mEffects.apply( new VertexEffectDistort(dLeft , pLeft , rLeft ) );
......
155 167
      mScreen.detachAll();
156 168
      mScreen.attach(mTexture,mEffects,mMesh);
157 169

  
170
      // All effects are by default disabled!
158 171
      VertexEffectDistort.enable();
159 172

  
160 173
      try

Also available in: Unified diff