Project

General

Profile

« Previous | Next » 

Revision 9e7b6dbd

Added by Leszek Koltunski over 5 years ago

Redefine the Vertex Region from (x,y,r,unused) to (x,y,z,r). This takes into account the 'Z', which makes it possible to warp only one side of a 3D Mesh like Sphere.

Also corresponding changes in applications.

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DEffect.java
392 392

  
393 393
    float factorX = act.getWidth() / 100.0f;
394 394
    float factorY = act.getHeight()/ 100.0f;
395
   // float factorZ = act.getDepth() / 100.0f;
395 396

  
396 397
    int deduct = (mName.getType() == EffectType.VERTEX ? 50:0);
397 398

  
398
    float  x = (mInterRegion[0]-deduct)*factorX;
399
    float  y = (mInterRegion[1]-deduct)*factorY;
400
    float rx =  mInterRegion[2]        *factorX;
401
    float ry =  mInterRegion[3]        *factorY;
399
    float x = (mInterRegion[0]-deduct)*factorX;
400
    float y = (mInterRegion[1]-deduct)*factorY;
401
    float z = (mInterRegion[2]-deduct)*factorX;   // ??
402
    float r =  mInterRegion[3]        *(factorX+factorY)/2;
402 403

  
403
    mRegionSta.set(x,y,rx,ry);
404
    mRegionSta.set(x,y,z,r);
404 405
    }
405 406

  
406 407
///////////////////////////////////////////////////////////////////////////////////////////////////
......
634 635
      seek[i].setProgress( mInterRegion[i] );
635 636
      }
636 637

  
637
    act.setRegion(mRegionSta.get1(),mRegionSta.get2(),mRegionSta.get3());
638
    act.setRegion(mRegionSta.get1(),mRegionSta.get2(),mRegionSta.get3(), mRegionSta.get4() );
638 639

  
639 640
    return mRegion;
640 641
    }
......
764 765
      view.getRenderer().showRegionAndCenter( showR,showC );
765 766

  
766 767
      act.setCenter(mCenterSta.get1(),mCenterSta.get2(),mCenterSta.get3());
767
      act.setRegion(mRegionSta.get1(),mRegionSta.get2(),mRegionSta.get3());
768
      act.setRegion(mRegionSta.get1(),mRegionSta.get2(),mRegionSta.get3(), mRegionSta.get4());
768 769
      }
769 770
    }
770 771

  

Also available in: Unified diff