Revision 7bebb196
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/library/effect/VertexEffectPinch.java | ||
---|---|---|
53 | 53 |
boolean ret = mPinch.get(uniforms,index,currentDuration,step); |
54 | 54 |
|
55 | 55 |
uniforms[index+1] = (float)(Math.PI*uniforms[index+1]/180); |
56 |
uniforms[index+REGION_OFFSET+1] =-uniforms[index+REGION_OFFSET+1]; // region's y |
|
57 | 56 |
|
58 | 57 |
return ret; |
59 | 58 |
} |
... | ... | |
75 | 74 |
addEffect(EffectName.PINCH, |
76 | 75 |
|
77 | 76 |
"vec3 center = vUniforms[effect+1].yzw; \n" |
78 |
+ "vec3 ps = center-v.xyz; \n"
|
|
77 |
+ "vec3 ps = center-v; \n" |
|
79 | 78 |
+ "float h = vUniforms[effect].x; \n" |
80 | 79 |
+ "float t = degree(vUniforms[effect+2],center,ps) * (1.0-h)/max(1.0,h); \n" |
81 | 80 |
+ "float angle = vUniforms[effect].y; \n" |
Also available in: Unified diff
Massive: make the coordinate system agree with that of OpenGL (i.e. invert the Y axis).