Revision 811ffcf5
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/examples/meshjoin/MeshJoinRenderer.java | ||
---|---|---|
57 | 57 |
private DistortedEffects mEffects; |
58 | 58 |
private Static3D mScale; |
59 | 59 |
private MeshBase mMesh; |
60 |
private int mSinkAssociation; |
|
61 |
private VertexEffectSink mSink; |
|
60 | 62 |
|
61 | 63 |
Static4D mQuat1, mQuat2; |
62 | 64 |
int mScreenMin; |
... | ... | |
83 | 85 |
quatInt1.add(mQuat1); |
84 | 86 |
quatInt2.add(mQuat2); |
85 | 87 |
|
88 |
mSinkAssociation = 15; |
|
89 |
mSink = new VertexEffectSink( sink, center, new Static4D(0,0,0,0.75f) ); |
|
90 |
mSink.setMeshAssociation(mSinkAssociation); |
|
91 |
|
|
86 | 92 |
mEffects = new DistortedEffects(); |
87 | 93 |
mEffects.apply( new MatrixEffectQuaternion(quatInt2, center) ); |
88 | 94 |
mEffects.apply( new MatrixEffectQuaternion(quatInt1, center) ); |
89 | 95 |
mEffects.apply( new MatrixEffectScale(mScale)); |
90 |
mEffects.apply( new VertexEffectSink( sink, center, new Static4D(0,0,0,0.75f) ) );
|
|
96 |
mEffects.apply( mSink );
|
|
91 | 97 |
|
92 | 98 |
mScreen.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); |
93 | 99 |
} |
... | ... | |
139 | 145 |
|
140 | 146 |
void setChecked(int number, boolean checked) |
141 | 147 |
{ |
142 |
android.util.Log.e("renderer", "Checkbox "+number+" checked: "+checked); |
|
148 |
int n = (0x1 << number); |
|
149 |
|
|
150 |
if( checked ) mSinkAssociation |= n; |
|
151 |
else mSinkAssociation &= (15-n); |
|
152 |
|
|
153 |
mSink.setMeshAssociation(mSinkAssociation); |
|
143 | 154 |
} |
144 | 155 |
|
145 | 156 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress with MeshJoin - sink association control done!