Revision 81dd14c8
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java | ||
---|---|---|
68 | 68 |
mView = v; |
69 | 69 |
|
70 | 70 |
mMesh = new MeshFlat(1,1); // no vertex effects, grid can be a (1x1) quad. |
71 |
mEffects = new DistortedEffects(); |
|
72 | 71 |
|
73 |
Dynamic3D move = new Dynamic3D(DURATION,0.0f);
|
|
72 |
Dynamic3D moveDyn= new Dynamic3D(DURATION,0.0f);
|
|
74 | 73 |
mRotate = new Static3D(0,0,0); |
75 | 74 |
mMove = new Static3D(0,0,0); |
76 |
Static3D move2 = new Static3D(0,0,0); |
|
77 | 75 |
|
78 |
move.add(mMove); |
|
79 |
move.add(move2);
|
|
76 |
moveDyn.add(mMove);
|
|
77 |
moveDyn.add(new Static3D(0,0,0));
|
|
80 | 78 |
|
81 | 79 |
Static4D chromaRegion= new Static4D( 530, 200,100,100); |
82 | 80 |
Static4D alphaRegion = new Static4D( 230, 200,100,100); |
... | ... | |
94 | 92 |
diRotate.add(new Static1D( 0)); |
95 | 93 |
diRotate.add(new Static1D(360)); |
96 | 94 |
|
95 |
mEffects = new DistortedEffects(); |
|
97 | 96 |
mEffects.apply( new FragmentEffectChroma( chromaDyn, new Static3D(1,0,0), chromaRegion ,true) ); |
98 | 97 |
mEffects.apply( new FragmentEffectAlpha(alphaDyn, alphaRegion, false) ); |
99 |
mEffects.apply( new MatrixEffectMove(mMove));
|
|
98 |
mEffects.apply( new MatrixEffectMove(moveDyn));
|
|
100 | 99 |
mEffects.apply( new MatrixEffectScale(diScale)); |
101 | 100 |
mEffects.apply( new MatrixEffectRotate( diRotate, new Static3D(0,0,1), mRotate) ); |
102 | 101 |
|
... | ... | |
108 | 107 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
109 | 108 |
{ |
110 | 109 |
mMove.set(width-mObjWidth,height-mObjHeight,0); |
111 |
mRotate.set(mObjWidth/2,mObjHeight/2,0); |
|
112 | 110 |
mScreen.resize(width, height); |
113 | 111 |
} |
114 | 112 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
140 | 138 |
|
141 | 139 |
mObjHeight = bitmap.getHeight(); |
142 | 140 |
mObjWidth = bitmap.getWidth(); |
141 |
mRotate.set(mObjWidth/2,mObjHeight/2,0); |
|
143 | 142 |
|
144 | 143 |
if( mTexture==null ) mTexture = new DistortedTexture(mObjWidth,mObjHeight); |
145 | 144 |
mTexture.setTexture(bitmap); |
Also available in: Unified diff
Fix 'Cat and Dog' APP. Now 24 out of 31 APPs work.