Project

General

Profile

« Previous | Next » 

Revision b3b2c6cf

Added by Leszek Koltunski over 7 years ago

Progress with any depth MeshCubes.

View differences:

src/main/java/org/distorted/examples/effects3d/Effects3DActivity.java
63 63

  
64 64
  private int mNumCols = 10;
65 65
  private int mNumRows = 10;
66
  private int mNumSlic =  1;
66 67
  private boolean mGridInitialized;
67
  private NumberPicker mColsPicker, mRowsPicker;
68
  private NumberPicker mColsPicker, mRowsPicker, mSlicPicker;
68 69
  private boolean[] mShape;
69 70
  private DistortedTexture mTexture;
70 71
  private DistortedEffects mEffects;
......
105 106

  
106 107
    mColsPicker = (NumberPicker)findViewById(R.id.objectpicker_cols);
107 108
    mRowsPicker = (NumberPicker)findViewById(R.id.objectpicker_rows);
109
    mSlicPicker = (NumberPicker)findViewById(R.id.objectpicker_slices);
108 110

  
109 111
    mColsPicker.setMaxValue(40);
110 112
    mColsPicker.setMinValue( 0);
111 113
    mRowsPicker.setMaxValue(40);
112 114
    mRowsPicker.setMinValue( 0);
115
    mSlicPicker.setMaxValue(40);
116
    mSlicPicker.setMinValue( 0);
113 117

  
114 118
    mColsPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
115 119
         {
......
129 133
           }
130 134
         });
131 135

  
136
    mSlicPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
137
         {
138
         @Override
139
         public void onValueChange(NumberPicker picker, int oldVal, int newVal)
140
           {
141
           mNumSlic = mSlicPicker.getValue();
142
           }
143
         });
144

  
132 145
    mObjectType = 0;
133 146
    mGridInitialized = false;
134 147

  
......
425 438
      for(int i=0; i<mNumRows*mNumCols; i++)
426 439
        str += mShape[i] ? "1" : "0";
427 440

  
428
      mMesh = new MeshCubes(mNumCols, str, 1);
441
      mMesh = new MeshCubes(mNumCols, str, mNumSlic);
429 442
      }
430 443

  
431 444
    mMesh.setShowNormals(mShowNormal);
......
693 706

  
694 707
    mColsPicker.setValue(mNumCols);
695 708
    mRowsPicker.setValue(mNumRows);
709
    mSlicPicker.setValue(mNumSlic);
696 710

  
697 711
    if( !mGridInitialized ) setGrid();
698 712
    }
src/main/res/layout/objectpickerlayout.xml
46 46
               android:descendantFocusability="blocksDescendants"
47 47
           />
48 48

  
49
           <NumberPicker
50
               android:id="@+id/objectpicker_slices"
51
               android:layout_width="wrap_content"
52
               android:layout_height="wrap_content"
53
               android:orientation="vertical"
54
               android:descendantFocusability="blocksDescendants"
55
           />
56

  
49 57
           <Button
50 58
               android:id="@+id/objectpicker_create"
51 59
               android:onClick="Create"

Also available in: Unified diff