Project

General

Profile

« Previous | Next » 

Revision 5e23b17b

Added by Leszek Koltunski about 5 years ago

Make the 'PINCH' effect fully 3D (define its acting line in terms of (latitude,longitude) angle pair).

Still, something is not fully working in the Earth app with the effect - investigate.

View differences:

src/main/java/org/distorted/examples/earth/EarthRenderer.java
50 50
import org.distorted.library.type.Dynamic3D;
51 51
import org.distorted.library.type.DynamicQuat;
52 52
import org.distorted.library.type.Static1D;
53
import org.distorted.library.type.Static2D;
54 53
import org.distorted.library.type.Static3D;
55 54
import org.distorted.library.type.Static4D;
56 55
import org.distorted.library.type.Static5D;
......
89 88
    private Static3D mRegionF;
90 89
    private Static4D mRegionV;
91 90
    private Static1D mStrength;
92
    private Static2D mPinch;
91
    private Static3D mPinch;
93 92
    private Static1D mSwirl;
94 93

  
95 94
    Static4D mQuat1, mQuat2;
......
110 109
      mMove       = new Static3D(0,0,0);
111 110
      mScaleFactor= new Static3D(1,1,1);
112 111
      mCenter     = new Static3D(0,0,0);
113
      mPinch      = new Static2D(0.5f,0.0f);
112
      mPinch      = new Static3D(0.5f,0.0f,0.0f);
114 113
      mSwirl      = new Static1D(45.0f);
115 114

  
116 115
      Dynamic3D scale = new Dynamic3D(0,0.5f);
......
214 213
        case DEFORM           : vector = new Static3D( +x*mObjWidth/CORR, +y*mObjHeight/CORR, +z*mObjDepth/CORR);
215 214
                                effect = new VertexEffectDeform (   vector, center, mRegionV); break;
216 215
        case SINK             : effect = new VertexEffectSink   (mStrength, center, mRegionV); break;
217
        case PINCH            : effect = new VertexEffectPinch  (mPinch   , center, mRegionV); break;      // Those 3 are not really
218
        case SWIRL            : effect = new VertexEffectSwirl  (mSwirl   , center, mRegionV); break;      // fully 3D effects. They
219
        case WAVE             : Static5D wave = new Static5D( RADIUS_V/2, RADIUS_V/2, 0, 90-latitude, 90); // will not look good
220
                                effect = new VertexEffectWave   (wave     , center, mRegionV); break;      // everywhere on the sphere.
216
        case PINCH            : mPinch.set2(latitude);//>0 ? (float)(Math.PI/2 - latitude) : (float)(-Math.PI/2 - latitude) );
217
                                mPinch.set3(longitude);// (float)(Math.PI+longitude) );
218
                                effect = new VertexEffectPinch  (mPinch   , center, mRegionV); break;
219
        case SWIRL            : effect = new VertexEffectSwirl  (mSwirl   , center, mRegionV); break;      // SWIRL & WAVE are not really fully
220
        case WAVE             : Static5D wave = new Static5D( RADIUS_V/2, RADIUS_V/2, 0, 90-latitude, 90); // 3D effects. They will not look
221
                                effect = new VertexEffectWave   (wave     , center, mRegionV); break;      // good everywhere on the sphere.
221 222

  
222 223
        case ALPHA            : effect = new FragmentEffectAlpha     (mStrength,        center, mRegionF, false); break;
223 224
        case SMOOTH_ALPHA     : effect = new FragmentEffectAlpha     (mStrength,        center, mRegionF, true ); break;

Also available in: Unified diff