Revision 849e0034
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/deform/DeformRenderer.java | ||
---|---|---|
236 | 236 |
|
237 | 237 |
void down(int x, int y) |
238 | 238 |
{ |
239 |
int xt = x-(scrWidth -textureWidth )/2; |
|
240 |
int yt = y-(scrHeight-textureHeight)/2; |
|
241 |
|
|
242 |
yt = textureHeight - yt; // OpenGL coord system and 2D coords have inverted Y axis |
|
239 |
int xt = x-(scrWidth/2); |
|
240 |
int yt = (scrHeight/2)-y; |
|
243 | 241 |
|
244 | 242 |
switch(mMode) |
245 | 243 |
{ |
... | ... | |
256 | 254 |
case SHEAR : vShear[0].set(0,0,0); |
257 | 255 |
mEffects.apply(mMovingShear); |
258 | 256 |
mLastEffect = mMovingShear.getID(); |
259 |
mTouchPoint.set(xt-textureWidth/2,yt-textureHeight/2,0);
|
|
257 |
mTouchPoint.set(xt,yt,0);
|
|
260 | 258 |
break; |
261 | 259 |
} |
262 | 260 |
} |
Also available in: Unified diff
Moving the Vertex and Fragment centers of effect to the center of the Mesh.