Revision 849e0034
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
---|---|---|
51 | 51 |
private DistortedScreen mScreen; |
52 | 52 |
private DistortedTexture mTexture; |
53 | 53 |
private MeshRectangles mMesh; |
54 |
private Static3D mScale, mBrowL, mBrowR;
|
|
54 |
private Static3D mScale; |
|
55 | 55 |
|
56 | 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
57 | 57 |
|
... | ... | |
59 | 59 |
{ |
60 | 60 |
mView = v; |
61 | 61 |
|
62 |
|
|
62 |
Static3D pointLeft = new Static3D(-85, 57, 0); |
|
63 |
Static3D pointRight = new Static3D( 50, 100, 0); |
|
63 | 64 |
Static4D regionLeft = new Static4D( -3, 33, 0, 47); |
64 | 65 |
Static4D regionRight= new Static4D(-14, 33, 0, 47); |
65 | 66 |
Dynamic3D dynLeft = new Dynamic3D(2000,0.0f); |
... | ... | |
83 | 84 |
dynRight.add(vect1); |
84 | 85 |
|
85 | 86 |
mScale= new Static3D(1,1,1); |
86 |
mBrowL= new Static3D(0,0,0); |
|
87 |
mBrowR= new Static3D(0,0,0); |
|
88 | 87 |
|
89 | 88 |
mEffects = new DistortedEffects(); |
90 |
mEffects.apply( new VertexEffectDistort(dynLeft , mBrowL, regionLeft) );
|
|
91 |
mEffects.apply( new VertexEffectDistort(dynRight, mBrowR, regionRight));
|
|
89 |
mEffects.apply( new VertexEffectDistort(dynLeft , pointLeft , regionLeft) );
|
|
90 |
mEffects.apply( new VertexEffectDistort(dynRight, pointRight, regionRight));
|
|
92 | 91 |
mEffects.apply( new MatrixEffectScale(mScale) ); |
93 | 92 |
|
94 | 93 |
mScreen = new DistortedScreen(); |
... | ... | |
136 | 135 |
int bmpHeight = bitmap.getHeight(); |
137 | 136 |
int bmpWidth = bitmap.getWidth(); |
138 | 137 |
|
139 |
mBrowL.set( 98 - bmpWidth/2, 297 - bmpHeight/2, 0); |
|
140 |
mBrowR.set(233 - bmpWidth/2, 340 - bmpHeight/2, 0); |
|
141 |
|
|
142 | 138 |
if( mTexture==null ) mTexture = new DistortedTexture(); |
143 | 139 |
mTexture.setTexture(bitmap); |
144 | 140 |
|
Also available in: Unified diff
Moving the Vertex and Fragment centers of effect to the center of the Mesh.