Project

General

Profile

« Previous | Next » 

Revision 463f1f9c

Added by Leszek Koltunski over 7 years ago

Progress with Glow.

View differences:

src/main/java/org/distorted/examples/blur/BlurRenderer.java
98 98
    
99 99
   public void onSurfaceChanged(GL10 glUnused, int width, int height)
100 100
     {
101
     if( (float)mObjHeight/mObjWidth > (float)height/width )
102
       {
103
       int w = (height*mObjWidth)/mObjHeight;
104
       float factor = (float)height/mObjHeight;
105
       mMove.set((width-w)/2,0,0);
106
       mScale.set(factor,factor,factor);
107
       }
108
     else
109
       {
110
       int h = (width*mObjHeight)/mObjWidth;
111
       float factor = (float)width/mObjWidth;
112
       mMove.set(0,(height-h)/2,0);
113
       mScale.set(factor,factor,factor);
114
       }
115

  
116
     mScreen.resize(width,height);
101
     float qw = (float)width /mObjWidth;
102
     float qh = (float)height/mObjHeight;
103
     float factor = 0.8f* (qw<qh ? qw:qh);
104
     int w = (int)(factor*mObjWidth);
105
     int h = (int)(factor*mObjHeight);
106

  
107
     mMove.set((width-w)/2 ,(height-h)/2, 0);
108
     mScale.set( factor,factor,factor );
109
     mScreen.resize(width, height);
117 110
     }
118 111

  
119 112
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/examples/glow/GlowRenderer.java
112 112
     {
113 113
     float qw = (float)width /mRootW;
114 114
     float qh = (float)height/mRootH;
115
     float factor = 0.1f* (qw<qh ? qw:qh);
115
     float factor = 0.5f* (qw<qh ? qw:qh);
116 116
     int w = (int)(factor*mRootW);
117 117
     int h = (int)(factor*mRootH);
118 118

  

Also available in: Unified diff