Project

General

Profile

« Previous | Next » 

Revision 39b925d5

Added by Leszek Koltunski over 3 years ago

Progress with the MeshFile app: disappear works now.

View differences:

src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java
29 29
import org.distorted.examples.R;
30 30
import org.distorted.library.effect.MatrixEffectQuaternion;
31 31
import org.distorted.library.effect.MatrixEffectScale;
32
import org.distorted.library.effect.VertexEffectDisappear;
32 33
import org.distorted.library.main.DistortedEffects;
33 34
import org.distorted.library.main.DistortedLibrary;
34 35
import org.distorted.library.main.DistortedScreen;
......
83 84
      quatInt1.add(mQuat1);
84 85
      quatInt2.add(mQuat2);
85 86

  
87
      VertexEffectDisappear disappear = new VertexEffectDisappear();
88
      disappear.setMeshAssociation(1,-1);
89

  
86 90
      mEffects = new DistortedEffects();
87 91
      mEffects.apply( new MatrixEffectQuaternion(quatInt2, center) );
88 92
      mEffects.apply( new MatrixEffectQuaternion(quatInt1, center) );
89 93
      mEffects.apply( new MatrixEffectScale(mScale));
90 94

  
95
      mEffects.apply( disappear );
96

  
91 97
      mScreen.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
92 98
      mScreen.showFPS();
93 99
      }
......
115 121
      {
116 122
      if( mTexture==null ) mTexture = new DistortedTexture();
117 123

  
124
      VertexEffectDisappear.enable();
125

  
118 126
      DistortedLibrary.onCreate(mView.getContext(), this);
119 127
      }
120 128

  
......
304 312
      DataInputStream dos = new DataInputStream(is);
305 313
      mMesh = new MeshFile(dos);
306 314

  
315
      int numEff = mMesh.numEffComponents();
316

  
317
      for(int i=0; i<numEff; i++)
318
        {
319
        mMesh.setEffectAssociation(i, 0, i);
320
        }
321

  
307 322
      try
308 323
        {
309 324
        is.close();
......
314 329
        }
315 330
      }
316 331

  
332
///////////////////////////////////////////////////////////////////////////////////////////////////
333

  
334
    MeshFile getMesh()
335
      {
336
      return mMesh;
337
      }
338

  
317 339
///////////////////////////////////////////////////////////////////////////////////////////////////
318 340

  
319 341
    long getTime()

Also available in: Unified diff