Project

General

Profile

« Previous | Next » 

Revision 687263cc

Added by Leszek Koltunski about 4 years ago

Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)

View differences:

src/main/java/org/distorted/examples/inflate/InflateRenderer.java
72 72
      InflateActivity2 act = (InflateActivity2)v.getContext();
73 73

  
74 74
      mTexture = act.getTexture();
75
      mMesh = act.getMesh();
75
      mMesh    = act.getMesh();
76 76

  
77
      mObjWidth = mTexture.getWidth();
78
      mObjHeight= mTexture.getHeight();
79
      mObjDepth = mTexture.getDepth(mMesh);
77
      mObjWidth = act.getNumCols();
78
      mObjHeight= act.getNumRows();
79
      mObjDepth = act.getNumSlic();
80 80

  
81 81
      mQuat1 = new Static4D(0,0,0,1);  // unity
82 82
      mQuat2 = new Static4D(0,0,0,1);  // quaternions
......
87 87
      quatInt1.add(mQuat1);
88 88
      quatInt2.add(mQuat2);
89 89

  
90
      mEffects = new DistortedEffects();
90
      mEffects = new DistortedEffects(mObjWidth,mObjHeight,mObjDepth);
91 91
      mEffects.apply( new MatrixEffectQuaternion(quatInt2, mCenter) );
92 92
      mEffects.apply( new MatrixEffectQuaternion(quatInt1, mCenter) );
93 93
      mEffects.apply( new MatrixEffectScale(mScale));

Also available in: Unified diff