Revision 3c8b1903
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java | ||
---|---|---|
203 | 203 |
di3D.removeAll(); |
204 | 204 |
mRegion.removeAll(); |
205 | 205 |
mCurrEffect = EFFECT_POINTS; |
206 |
mRenderer.setRefresh(); |
|
206 | 207 |
} |
207 | 208 |
} |
208 | 209 |
|
... | ... | |
216 | 217 |
|
217 | 218 |
float[] drawCoord = new float[3]; |
218 | 219 |
Static3D cu; |
219 |
int lit = mTime> 0 ? (int)((float)(time-mTime)*NUM_POINTS/LOOP_TIME) : 0; |
|
220 |
|
|
220 |
|
|
221 | 221 |
if( len>=2 ) |
222 | 222 |
{ |
223 | 223 |
float step = (float)LOOP_TIME/(NUM_POINTS+1); |
224 | 224 |
|
225 | 225 |
for(int i=0; i<NUM_POINTS; i++) |
226 | 226 |
{ |
227 |
int color = i<=lit ? 0xff - (lit -i)*0xff/(NUM_POINTS-1) |
|
228 |
: 0xff - (lit+NUM_POINTS-i)*0xff/(NUM_POINTS-1); |
|
229 |
|
|
230 |
mPaint.setColor( 0xffffff + ((color&0xff)<<24) ); |
|
227 |
mPaint.setColor( 0xffffffff ); |
|
231 | 228 |
di3D.interpolateMain( drawCoord, 0, (long)(i*step) ); |
232 | 229 |
c.drawCircle(drawCoord[0], drawCoord[1], mSize1, mPaint ); |
233 | 230 |
} |
... | ... | |
281 | 278 |
di3D.add(new Static3D(xDown,yDown,0)); |
282 | 279 |
mRegion.add(new Static4D(xDown,yDown,mSizeR,mSizeR)); |
283 | 280 |
} |
284 |
} |
|
281 |
} |
|
282 |
mRenderer.setRefresh(); |
|
285 | 283 |
break; |
286 | 284 |
case MotionEvent.ACTION_MOVE: if( moving>=0 ) |
287 | 285 |
{ |
... | ... | |
290 | 288 |
|
291 | 289 |
di3D.setPoint(moving, xDown, yDown, 0); |
292 | 290 |
mRegion.setPoint(moving, xDown, yDown, mSizeR, mSizeR); |
293 |
} |
|
291 |
} |
|
292 |
mRenderer.setRefresh(); |
|
294 | 293 |
break; |
295 | 294 |
case MotionEvent.ACTION_UP : moving = -1; |
296 | 295 |
break; |
Also available in: Unified diff
Major restructuring with DistortedTexture. One now is able to create Textures anywhere, even from a thread which does not hold the OpenGL context. Same for DistortedFramebuffers.