Revision b4237a76
Added by Leszek Koltunski about 8 years ago
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java | ||
---|---|---|
49 | 49 |
|
50 | 50 |
private GLSurfaceView mView; |
51 | 51 |
private DistortedBitmap[] bmp; |
52 |
private Static2D point;
|
|
52 |
private Static2D mPoint;
|
|
53 | 53 |
private Dynamic3D dDistort; |
54 |
private Static3D[] vec; |
|
55 | 54 |
private int bmpHeight, bmpWidth; |
56 | 55 |
|
57 | 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
58 | 57 |
|
59 |
public DifferentBitmapsRenderer(GLSurfaceView v)
|
|
58 |
DifferentBitmapsRenderer(GLSurfaceView v)
|
|
60 | 59 |
{ |
61 | 60 |
mView = v; |
62 | 61 |
|
63 | 62 |
// create shared effects - enlarge the nose and keep moving the whole bitmap left and right. |
64 | 63 |
dDistort = new Dynamic3D(3000,0.0f); |
65 |
vec = new Static3D[2]; |
|
66 |
vec[0] = new Static3D( 25,0,0); |
|
67 |
vec[1] = new Static3D(-25,0,0); |
|
68 |
dDistort.add(vec[0]); |
|
69 |
dDistort.add(vec[1]); |
|
70 |
point = new Static2D(305, 380); |
|
64 |
dDistort.add(new Static3D( 25,0,0)); |
|
65 |
dDistort.add(new Static3D(-25,0,0)); |
|
66 |
mPoint = new Static2D(305, 380); |
|
71 | 67 |
} |
72 | 68 |
|
73 | 69 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
162 | 158 |
bmp[1].setBitmap(bitmap1); |
163 | 159 |
bmp[2].setBitmap(bitmap2); |
164 | 160 |
|
165 |
bmp[0].sink( new Static1D(8), point, new Static4D(0,0,80,80));
|
|
166 |
bmp[0].distort(dDistort,point);
|
|
161 |
bmp[0].sink( new Static1D(8), mPoint, new Static4D(0,0,80,80));
|
|
162 |
bmp[0].distort(dDistort,mPoint);
|
|
167 | 163 |
|
168 | 164 |
try |
169 | 165 |
{ |
Also available in: Unified diff
TIdy up the 'DifferentBitmaps app'