Project

General

Profile

« Previous | Next » 

Revision 1585ba24

Added by Leszek Koltunski over 5 years ago

Make the Fragment effects truly 3D: change their 4D 'region' into a 3D 'center' (a point in 3D) and 3D 'region' (which is now a set of 3 radii defining an ellipsoid around the center)

Also corresponding changes to the applications.

View differences:

src/main/java/org/distorted/examples/effectqueue/EffectQueueSurfaceView.java
41 41

  
42 42
public class EffectQueueSurfaceView extends GLSurfaceView
43 43
  {
44
  private static final int RADIUS = 60;
44
  private static final int RADIUS = EffectQueueRenderer.BWID/6;
45 45

  
46 46
  private EffectQueueRenderer mRenderer;
47 47
  private int mCurrentEffect;
......
51 51
  private Dynamic1D mInterA, mInterB, mInterC, mInterS;
52 52
  private Dynamic3D mInterD;
53 53

  
54
  private final static Static3D mRED = new Static3D(1,0,0);
54
  private final static Static3D mRED    = new Static3D(1,0,0);
55
  private final static Static3D mREGION = new Static3D(RADIUS,RADIUS,RADIUS);
55 56

  
56 57
///////////////////////////////////////////////////////////////////////////////////////////////////
57 58
    
......
146 147
                                              success = mRenderer.getEffects().apply(sink);
147 148
                                              act.effectAdded(success,sink);
148 149
                                              break;
149
                                      case 2: FragmentEffectAlpha alpha = new FragmentEffectAlpha(mInterA, new Static4D(x,y,RADIUS,RADIUS), true);
150
                                      case 2: FragmentEffectAlpha alpha = new FragmentEffectAlpha(mInterA, new Static3D(x,y,0), mREGION, true);
150 151
                                              success = mRenderer.getEffects().apply(alpha);
151 152
                                              act.effectAdded(success,alpha);
152 153
                                              break;
153
                                      case 3: FragmentEffectSaturation saturation = new FragmentEffectSaturation(mInterB, new Static4D(x,y,RADIUS,RADIUS), false);
154
                                      case 3: FragmentEffectSaturation saturation = new FragmentEffectSaturation(mInterB, new Static3D(x,y,0), mREGION, false);
154 155
                                              success = mRenderer.getEffects().apply(saturation);
155 156
                                              act.effectAdded(success,saturation);
156 157
                                              break;
157
                                      case 4: FragmentEffectChroma chroma = new FragmentEffectChroma(mInterC, mRED, new Static4D(x,y,RADIUS,RADIUS), true);
158
                                      case 4: FragmentEffectChroma chroma = new FragmentEffectChroma(mInterC, mRED, new Static3D(x,y,0), mREGION, true);
158 159
                                              success = mRenderer.getEffects().apply(chroma);
159 160
                                              act.effectAdded(success,chroma);
160 161
                                              break;

Also available in: Unified diff