Revision a4d59c0b
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/examples/flag/FlagRenderer.java | ||
---|---|---|
50 | 50 |
class FlagRenderer implements GLSurfaceView.Renderer |
51 | 51 |
{ |
52 | 52 |
private GLSurfaceView mView; |
53 |
private DistortedEffects mEffects; |
|
54 | 53 |
private DistortedTexture mTexture; |
55 | 54 |
private DistortedScreen mScreen; |
56 | 55 |
private Dynamic5D mWaveDyn; |
... | ... | |
67 | 66 |
{ |
68 | 67 |
mView = v; |
69 | 68 |
|
70 |
mEffects = new DistortedEffects(); |
|
71 | 69 |
mTexture = new DistortedTexture(500,300); |
72 | 70 |
|
73 | 71 |
mObjWidth = mTexture.getWidth(); |
... | ... | |
87 | 85 |
Static3D waveCenter = new Static3D(mObjWidth, mObjHeight/2, 0); // middle of the right edge |
88 | 86 |
Static4D waveRegion = new Static4D(0,0,0,mObjWidth); |
89 | 87 |
|
90 |
mEffects.apply( new VertexEffectWave(mWaveDyn, waveCenter, waveRegion) ); |
|
88 |
DistortedEffects effects = new DistortedEffects(); |
|
89 |
effects.apply( new VertexEffectWave(mWaveDyn, waveCenter, waveRegion) ); |
|
91 | 90 |
|
92 | 91 |
mMove = new Static3D(0,0,0); |
93 | 92 |
mScale = new Static3D(1,1,1); |
94 | 93 |
mCenter= new Static3D(0,0,0); |
95 | 94 |
|
96 |
mEffects.apply( new MatrixEffectMove(mMove));
|
|
97 |
mEffects.apply( new MatrixEffectScale(mScale));
|
|
98 |
mEffects.apply( new MatrixEffectQuaternion(mQuat1, mCenter) );
|
|
99 |
mEffects.apply( new MatrixEffectQuaternion(mQuat2, mCenter) );
|
|
95 |
effects.apply( new MatrixEffectMove(mMove));
|
|
96 |
effects.apply( new MatrixEffectScale(mScale));
|
|
97 |
effects.apply( new MatrixEffectQuaternion(mQuat1, mCenter) );
|
|
98 |
effects.apply( new MatrixEffectQuaternion(mQuat2, mCenter) );
|
|
100 | 99 |
|
101 | 100 |
mScreen = new DistortedScreen(); |
102 |
mScreen.attach(mTexture,mEffects, new MeshCubes(50,30,1) );
|
|
101 |
mScreen.attach(mTexture, effects, new MeshCubes(50,30,1) );
|
|
103 | 102 |
} |
104 | 103 |
|
105 | 104 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Massive: make the coordinate system agree with that of OpenGL (i.e. invert the Y axis).