Project

General

Profile

« Previous | Next » 

Revision 1a3f8cc2

Added by Leszek Koltunski about 6 years ago

Some improvements for 'Moving Glow'

View differences:

src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java
73 73
      {     
74 74
      mView = v;
75 75

  
76
      mRootW = 3*LEAF_SIZE;
77
      mRootH = 3*LEAF_SIZE;
76
      mRootW = 4*LEAF_SIZE;
77
      mRootH = 4*LEAF_SIZE;
78 78

  
79 79
      mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE);
80 80
      DistortedTexture surface = new DistortedTexture(mRootW,mRootH);
......
82 82

  
83 83
      DistortedNode root = new DistortedNode(surface, new DistortedEffects(), mesh);
84 84
     
85
      Static3D moveVector = new Static3D(0,LEAF_SIZE,0);
85
      Static3D moveVector = new Static3D(0.25f*LEAF_SIZE, (mRootH-LEAF_SIZE)/2, 0);
86 86
      Static1D chromaLevel= new Static1D(0.5f);
87
      Static3D center     = new Static3D(3*LEAF_SIZE/2, 3*LEAF_SIZE/2, 0);
87
      Static3D center     = new Static3D(mRootW/2, mRootH/2, 0);
88 88
      Static3D axis       = new Static3D(0,0,1);
89 89

  
90 90
      MatrixEffectMove leafMove = new MatrixEffectMove(moveVector);
......
119 119

  
120 120
      for(int leaf=0; leaf<NUM_LEAVES; leaf++)
121 121
        {
122
        Dynamic4D color  = new Dynamic4D(5000,1.0f);
123
        Static4D startC  = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 0);
124
        Static4D endC    = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 1);
125
        color.add(startC);
126
        color.add(endC);
122
        Dynamic4D color= new Dynamic4D(3000,0.5f);
123
        Static4D P1    = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 1);
124
        Static4D P2    = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 1);
125
        color.add(P1);
126
        color.add(P2);
127 127

  
128 128
        mGlow[leaf] = new PostprocessEffectGlow(radiusDyn,color);
129 129
        }
......
174 174
     {
175 175
     float qw = (float)width /mRootW;
176 176
     float qh = (float)height/mRootH;
177
     float factor = 0.6f* (qw<qh ? qw:qh);
177
     float factor = 0.9f* (qw<qh ? qw:qh);
178 178
     int w = (int)(factor*mRootW);
179 179
     int h = (int)(factor*mRootH);
180 180

  

Also available in: Unified diff