Revision e4330c89
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/examples/wind/WindRenderer.java | ||
---|---|---|
47 | 47 |
class WindRenderer implements GLSurfaceView.Renderer |
48 | 48 |
{ |
49 | 49 |
private GLSurfaceView mView; |
50 |
private DistortedEffects mEffects; |
|
51 | 50 |
private DistortedTexture mTexture; |
52 | 51 |
private DistortedScreen mScreen; |
53 | 52 |
private WindEffectsManager mManager; |
... | ... | |
61 | 60 |
{ |
62 | 61 |
mView = view; |
63 | 62 |
|
64 |
mEffects = new DistortedEffects(); |
|
65 | 63 |
mTexture = new DistortedTexture(50,30); |
66 | 64 |
mManager = new WindEffectsManager(mTexture); |
67 |
mScreen = new DistortedScreen(mView);
|
|
65 |
mScreen = new DistortedScreen(); |
|
68 | 66 |
|
69 |
mScreen.attach(mTexture,mEffects,new MeshCubes(50,30,1)); |
|
67 |
DistortedEffects effects = new DistortedEffects(); |
|
68 |
|
|
69 |
mScreen.attach(mTexture,effects,new MeshCubes(50,30,1)); |
|
70 | 70 |
|
71 | 71 |
mObjWidth = mTexture.getWidth(); |
72 | 72 |
mObjHeight= mTexture.getHeight(); |
73 | 73 |
|
74 | 74 |
mMove = new Static3D(0,0,0); |
75 | 75 |
mScale= new Static3D(1,1,1); |
76 |
mEffects.apply( new MatrixEffectMove(mMove));
|
|
77 |
mEffects.apply( new MatrixEffectScale(mScale));
|
|
76 |
effects.apply( new MatrixEffectMove(mMove));
|
|
77 |
effects.apply( new MatrixEffectScale(mScale));
|
|
78 | 78 |
|
79 | 79 |
Static1D angle = new Static1D(-45); |
80 | 80 |
Static3D axis = new Static3D(0,0,1); |
81 | 81 |
Static3D center= new Static3D(0,mObjHeight/2,0); |
82 | 82 |
|
83 |
mEffects.apply( new MatrixEffectRotate(angle, axis, center) );
|
|
84 |
mManager.apply(mEffects,mWind);
|
|
83 |
effects.apply( new MatrixEffectRotate(angle, axis, center) );
|
|
84 |
mManager.apply(effects,mWind);
|
|
85 | 85 |
} |
86 | 86 |
|
87 | 87 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Change of API: move setting the EGL context back to the APP.