Revision 3ea19d1c
Added by Leszek Koltunski about 8 years ago
src/main/res/raw/main_vertex_shader.glsl | ||
---|---|---|
199 | 199 |
// Here we have to have X'(1) = 2(mx-flx)-vx which is positive <==> vx<2(mx-flx). We also have to |
200 | 200 |
// have vy<2(my-fly) so that Y'(t)>0 (this is a must otherwise we have local loops!) |
201 | 201 |
// Similarly for the Fr--->M' part of the curve we have the same equation except for the fact that |
202 |
// this time we have to have X'(1)<0 so now we have to have vx>2(mx-flx).
|
|
202 |
// this time we have to have X'(1)<0 so now we have to have vx>2(mx-frx).
|
|
203 | 203 |
// |
204 | 204 |
// If we are stretching the left or right edge of the bitmap then the only difference is that we |
205 | 205 |
// have to have (X'(1),Y'(1)) = (0,+-c) with + or - c depending on which part of the curve |
... | ... | |
210 | 210 |
// |
211 | 211 |
// If we are dragging the top edge: |
212 | 212 |
// |
213 |
// Now point (x,u_objD.x) on the top edge will move by vector (X(t),Y(t)) where those functions
|
|
214 |
// are given by (*) and t = x < dSx ? (u_objD.x+x)/(u_objD.x+dSx) : (u_objD.x-x)/(u_objD.x-dSx)
|
|
213 |
// Then point (x,h/2) on the top edge will move by vector (X(t),Y(t)) where those functions are
|
|
214 |
// given by (*) and t = x < dSx ? (w/2+x)/(w/2+dSx) : (w/2-x)/(w/2-dSx) (-w/2 < x < +w/2 !)
|
|
215 | 215 |
// (this is 'vec2 time' below in the code). |
216 |
// Any point (x,y) will move by vector (a*X(t),a*Y(t)) where a is (y+u_objD.y)/(2*u_objD.y)
|
|
216 |
// Any point (x,y) will move by vector (a*X(t),a*Y(t)) where a is (y+h/2)/h
|
|
217 | 217 |
|
218 | 218 |
void deform(in int effect, inout vec4 v) |
219 | 219 |
{ |
Also available in: Unified diff
rearrange comments