Project

General

Profile

« Previous | Next » 

Revision f988589e

Added by Leszek Koltunski almost 8 years ago

Further reduce the distortedObject's API - now only 26 methods, 1/4 of the 104 before the reorganization.

View differences:

src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
68 68
      RegionEye = new Static4D(0,0,60,60);
69 69
      
70 70
      // bmp[1] effects
71
      mDI = new Dynamic3D();
72
      mDI.setCount(0.0f);
73
      mDI.setDuration(1000);
71
      mDI = new Dynamic3D(1000,0.0f);
74 72
      vec = new Static3D[2];
75 73
      vec[0] = new Static3D( 50,0,0);
76 74
      vec[1] = new Static3D(-50,0,0);
......
106 104
        {
107 105
        int w = (height*bmpWidth)/bmpHeight;
108 106
        float factor = (float)height/bmpHeight;
109
        Static3D scaleFactor = new Static3D(factor,factor,factor);
110 107

  
111 108
        for(int i=NUM-1; i>=0; i--) 
112 109
          {
113 110
          bmp[i].move( new Static3D((width-NUM*w)/2 +i*w , 0, 0) );
114
          bmp[i].scale(scaleFactor);
111
          bmp[i].scale(factor);
115 112
          }
116 113
        }
117 114
      else
......
119 116
        int w = width/NUM;  
120 117
        int h = (width*bmpHeight)/(bmpWidth*NUM);
121 118
        float factor = (float)width/(bmpWidth*NUM);
122
        Static3D scaleFactor = new Static3D(factor,factor,factor);
123 119

  
124 120
        for(int i=NUM-1; i>=0; i--) 
125 121
          {
126 122
          bmp[i].move( new Static3D(i*w, (height-h)/2, 0) );
127
          bmp[i].scale(scaleFactor);
123
          bmp[i].scale(factor);
128 124
          }
129 125
        }
130 126
       
......
162 158
      // setting the bitmap once is enough; others are cloned!
163 159
      bmp[0].setBitmap(bitmap);
164 160

  
165
      Dynamic1D sink = new Dynamic1D();
166
      sink.setDuration(2000);
167
      sink.setCount(0);
161
      Dynamic1D sink = new Dynamic1D(2000,0.0f);
168 162
      sink.add(new Static1D( 1));
169 163
      sink.add(new Static1D(10));
170 164

  
......
172 166
      bmp[0].sink(sink, pRight,RegionEye);
173 167
      bmp[1].distort(mDI, pNose1);
174 168

  
175
      Dynamic1D macroblockDyn = new Dynamic1D();
176
      macroblockDyn.setDuration(3000);
177
      macroblockDyn.setCount(0);
169
      Dynamic1D macroblockDyn = new Dynamic1D(3000,0.0f);
178 170
      macroblockDyn.add(new Static1D(1));
179 171
      macroblockDyn.add(new Static1D(50));
180 172

  

Also available in: Unified diff