Revision 687263cc
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/generic/GenericActivity2.java | ||
---|---|---|
80 | 80 |
mShowNormal = false; |
81 | 81 |
mUseOIT = false; |
82 | 82 |
|
83 |
mEffects= new DistortedEffects(1); |
|
84 |
|
|
83 | 85 |
int maxsize = numCols > numRows ? (numCols>numSlic ? numCols:numSlic) : (numRows>numSlic ? numRows:numSlic) ; |
84 | 86 |
|
85 | 87 |
createBitmap(maxsize, bitmapID); |
... | ... | |
98 | 100 |
|
99 | 101 |
mMesh = new MeshCubes(numCols, str, numSlic, mapFB, mapFB, mapLR, mapLR, mapTB, mapTB); |
100 | 102 |
} |
103 |
mEffects.setStretch(numCols,numRows,numSlic); |
|
101 | 104 |
break; |
102 | 105 |
case 1: mMesh = new MeshRectangles(numCols,numRows); |
106 |
mEffects.setStretch(numCols,numRows,0); |
|
103 | 107 |
break; |
104 | 108 |
case 2: mMesh = new MeshSphere(numRows); |
109 |
mEffects.setStretch(numRows,numRows,numRows); |
|
105 | 110 |
break; |
106 | 111 |
case 3: mMesh = new MeshQuad(); |
107 | 112 |
break; |
108 | 113 |
} |
109 | 114 |
|
110 | 115 |
mMesh.setShowNormals(mShowNormal); |
111 |
mTexture= new DistortedTexture(numCols,numRows); |
|
112 |
mEffects= new DistortedEffects(); |
|
116 |
mTexture= new DistortedTexture(); |
|
113 | 117 |
|
114 | 118 |
final View view = getLayoutInflater().inflate(R.layout.genericlayout, null); |
115 | 119 |
|
... | ... | |
204 | 208 |
|
205 | 209 |
public int getWidth() |
206 | 210 |
{ |
207 |
return mTexture==null ? 0: mTexture.getWidth();
|
|
211 |
return mEffects==null ? 0: mEffects.getStartchX();
|
|
208 | 212 |
} |
209 | 213 |
|
210 | 214 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
211 | 215 |
|
212 | 216 |
public int getHeight() |
213 | 217 |
{ |
214 |
return mTexture==null ? 0: mTexture.getHeight();
|
|
218 |
return mEffects==null ? 0: mEffects.getStartchY();
|
|
215 | 219 |
} |
216 | 220 |
|
217 | 221 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
218 | 222 |
|
219 | 223 |
public int getDepth() |
220 | 224 |
{ |
221 |
return mTexture==null ? 0: mTexture.getDepth(mMesh);
|
|
225 |
return mEffects==null ? 0: mEffects.getStartchZ();
|
|
222 | 226 |
} |
223 | 227 |
|
224 | 228 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)