Project

General

Profile

« Previous | Next » 

Revision 76939f96

Added by Leszek Koltunski about 8 years ago

The Flag is waving!

View differences:

src/main/java/org/distorted/examples/flag/FlagRenderer.java
26 26

  
27 27
import org.distorted.examples.R;
28 28
import org.distorted.library.Distorted;
29
import org.distorted.library.DistortedBitmap;
30 29
import org.distorted.library.DistortedCubes;
31 30
import org.distorted.library.DistortedObject;
32 31
import org.distorted.library.EffectTypes;
32
import org.distorted.library.type.Dynamic;
33
import org.distorted.library.type.Dynamic5D;
33 34
import org.distorted.library.type.DynamicQuat;
35
import org.distorted.library.type.Static2D;
34 36
import org.distorted.library.type.Static3D;
35 37
import org.distorted.library.type.Static4D;
38
import org.distorted.library.type.Static5D;
36 39

  
37 40
import java.io.IOException;
38 41
import java.io.InputStream;
......
64 67
      mObjWidth = mObject.getWidth();
65 68
      mObjHeight= mObject.getHeight();
66 69

  
70
      Static2D mWaveCenter = new Static2D(mObjWidth, mObjHeight/2);  // middle of the right edge
71
      Static4D mWaveRegion = new Static4D(0,0,mObjWidth,mObjWidth);
72

  
73
      Dynamic5D mWaveDyn = new Dynamic5D(1000,0.0f);
74
      Static5D  mWaveSta1= new Static5D(50,100,-180,90,0);
75
      Static5D  mWaveSta2= new Static5D(50,100,+180,90,0);
76

  
77
      mWaveDyn.add(mWaveSta1);
78
      mWaveDyn.add(mWaveSta2);
79
      mWaveDyn.setMode(Dynamic.MODE_JUMP);
80

  
67 81
      mQuat1 = new Static4D(0,0,0,1);  // unity
68 82
      mQuat2 = new Static4D(0,0,0,1);  // quaternions
69 83

  
......
72 86

  
73 87
      mQuatInt1.add(mQuat1);
74 88
      mQuatInt2.add(mQuat2);
89

  
90
      mObject.wave(mWaveDyn, mWaveCenter, mWaveRegion);
75 91
      }
76 92

  
77 93
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff