Project

General

Profile

« Previous | Next » 

Revision 30e77a6c

Added by Leszek Koltunski over 8 years ago

Beginnings of the WAVE effect.

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DEffect.java
71 71
    switch(mName)
72 72
      {
73 73
      case DISTORT      :
74
      case DEFORM       : return 3;
74
      case DEFORM       :
75
      case WAVE         : return 3;
75 76

  
76 77
      case CHROMA       :
77 78
      case SMOOTH_CHROMA: return 4;
......
91 92
      case DEFORM : object.deform (mDyn3, mCenterDyn            ); break;
92 93
      case SINK   : object.sink   (mDyn1, mCenterDyn, mRegionDyn); break;
93 94
      case SWIRL  : object.swirl  (mDyn1, mCenterDyn, mRegionDyn); break;
95
      case WAVE   : object.wave   (mDyn3, mCenterDyn, mRegionDyn); break;
94 96

  
95 97
      case ALPHA            : object.alpha     (mDyn1,        mRegionDyn, false); break;
96 98
      case SMOOTH_ALPHA     : object.alpha     (mDyn1,        mRegionDyn, true ); break;
......
127 129
                              float z = (mInter[2]-50)*l;
128 130
                              mSta3.set(x,y,z);
129 131
                              break;
132
      case WAVE             : float l2 = mAct.get().getWidth()/50.0f;
133
                              float x2 = (mInter[0]-50)*l2;
134
                              float y2 = (mInter[1]-50)*180 / 50;
135
                              float z2 = (mInter[2]-50)*l2;
136
                              mSta3.set(x2,y2,z2);
137
                              break;
130 138
      case SINK             : mSta1.set(mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f);
131 139
                              break;
132 140
      case SWIRL            : mSta1.set( 3.6f*(mInter[0]-50) );
......
159 167
    switch(mName)
160 168
      {
161 169
      case DISTORT          :
162
      case DEFORM           : mInter[0] = 50;
170
      case DEFORM           :
171
      case WAVE             : mInter[0] = 50;
163 172
                              mInter[1] = 50;
164 173
                              mInter[2] = 50;
165 174
                              break;
......
187 196
    }
188 197

  
189 198
///////////////////////////////////////////////////////////////////////////////////////////////////
190
// requires knowledge about effect nature
191 199

  
192 200
  private void setText()
193 201
    {
......
198 206
      text+=(" "+((int)(mSta1.getX()*100))/100.0f);
199 207
      }
200 208

  
201
    if( mName==EffectNames.DISTORT || mName==EffectNames.DEFORM       ||
202
        mName==EffectNames.CHROMA  || mName==EffectNames.SMOOTH_CHROMA )
209
    if( mDimension>=3 )
203 210
      {
204 211
      int f1 = (int)mSta3.getX();
205 212
      int f2 = (int)mSta3.getY();

Also available in: Unified diff