Project

General

Profile

« Previous | Next » 

Revision 7908dbc2

Added by Leszek Koltunski about 8 years ago

New vertex effect 'PINCH'

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DEffect.java
90 90
      case DISTORT: mId = object.distort(mDyn3, mCenterDyn, mRegionDyn); break;
91 91
      case DEFORM : mId = object.deform (mDyn3, mCenterDyn            ); break;
92 92
      case SINK   : mId = object.sink   (mDyn1, mCenterDyn, mRegionDyn); break;
93
      case PINCH  : mId = object.pinch  (mDyn2, mCenterDyn, mRegionDyn); break;
93 94
      case SWIRL  : mId = object.swirl  (mDyn1, mCenterDyn, mRegionDyn); break;
94 95
      case WAVE   : mId = object.wave   (mDyn5, mCenterDyn, mRegionDyn); break;
95 96

  
......
157 158
                              break;
158 159
      case SWIRL            : mSta1.set( 3.6f*(mInter[0]-50) );
159 160
                              break;
161
      case SINK             : mSta1.set(mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f);
162
                              break;
163
      case PINCH            : float dp = mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f;
164
                              float ap = (mInter[1]-50)*180 / 50;
165
                              mSta2.set(dp,ap);
166
                              break;
167

  
160 168
      case ALPHA            :
161 169
      case SMOOTH_ALPHA     : mSta1.set(mInter[0]/100.0f);
162 170
                              break;
163
      case SINK             :
164 171
      case SATURATION       :
165 172
      case SMOOTH_SATURATION:
166 173
      case CONTRAST         :

Also available in: Unified diff