Revision eb507734
Added by Leszek Koltunski over 5 years ago
| src/main/java/org/distorted/examples/deferredjob/DeferredJobRenderer.java | ||
|---|---|---|
| 148 | 148 |
|
| 149 | 149 |
void apply(int number) |
| 150 | 150 |
{
|
| 151 |
mRotate.setMeshAssociation(number,0);
|
|
| 151 |
mRotate.setMeshAssociation(0,number);
|
|
| 152 | 152 |
mAngle.set(360); |
| 153 | 153 |
mAngleDyn.resetToBeginning(); |
| 154 | 154 |
} |
| ... | ... | |
| 184 | 184 |
MeshBase[] meshes = new MeshRectangles[MESHES]; |
| 185 | 185 |
|
| 186 | 186 |
meshes[0] = new MeshRectangles(1,1); |
| 187 |
meshes[0].setEffectAssociation(0,1,0); |
|
| 187 | 188 |
|
| 188 | 189 |
for(int i=1; i<MESHES; i++) |
| 189 | 190 |
{
|
| 190 | 191 |
meshes[i] = meshes[0].copy(true); |
| 192 |
meshes[i].setEffectAssociation(0,1,i); |
|
| 191 | 193 |
} |
| 192 | 194 |
|
| 193 | 195 |
Static4D[] lTextureMaps = new Static4D[MESHES]; |
| ... | ... | |
| 207 | 209 |
VertexEffectMove effect0 = new VertexEffectMove ( new Static3D(0,0,0.5f) ); |
| 208 | 210 |
VertexEffectRotate effect1 = new VertexEffectRotate( new Static1D(180), new Static3D(1,0,0), new Static3D(0,0,0) ); |
| 209 | 211 |
|
| 210 |
effect1.setMeshAssociation(1,0); // apply only to mesh[1] |
|
| 212 |
effect0.setMeshAssociation(1,0); // apply only to Components whose andAssoc has the least significant bit set, i.e. |
|
| 213 |
// to both meshes[0] and meshes[1] |
|
| 214 |
effect1.setMeshAssociation(0,1); // apply only to Components whose equAssoc is equal to 1, i.e. only to mesh[1] |
|
| 211 | 215 |
|
| 212 | 216 |
tmp[0].apply(effect0); |
| 213 | 217 |
tmp[0].apply(effect1); |
| ... | ... | |
| 218 | 222 |
tmp[0].mergeComponents(); |
| 219 | 223 |
tmp[1].mergeComponents(); |
| 220 | 224 |
|
| 225 |
tmp[0].setEffectAssociation(0,0,0); // set the equAssoc of the 0th (the only) component to 0 |
|
| 226 |
tmp[1].setEffectAssociation(0,0,1); // set the equAssoc of the 0th (the only) component to 1 |
|
| 227 |
|
|
| 221 | 228 |
MeshBase combined = new MeshJoined(tmp); |
| 222 | 229 |
|
| 223 | 230 |
VertexEffectMove moveL = new VertexEffectMove ( new Static3D(-0.6f,0,0) ); |
| 224 | 231 |
VertexEffectMove moveR = new VertexEffectMove ( new Static3D(+0.6f,0,0) ); |
| 225 | 232 |
|
| 226 |
moveL.setMeshAssociation(0,0); |
|
| 227 |
moveR.setMeshAssociation(1,0);
|
|
| 233 |
moveL.setMeshAssociation(0,0); // apply only to tmp[0]
|
|
| 234 |
moveR.setMeshAssociation(0,1); // apply only to tmp[1]
|
|
| 228 | 235 |
|
| 229 | 236 |
combined.apply(moveL); |
| 230 | 237 |
combined.apply(moveR); |
| src/main/java/org/distorted/examples/meshjoin/MeshJoinRenderer.java | ||
|---|---|---|
| 88 | 88 |
|
| 89 | 89 |
mSinkAssociation = 0; |
| 90 | 90 |
mSink = new VertexEffectSink( sink, center, new Static4D(0,0,0,0.75f) ); |
| 91 |
mSink.setMeshAssociation(-1,mSinkAssociation);
|
|
| 91 |
mSink.setMeshAssociation(mSinkAssociation,-1);
|
|
| 92 | 92 |
|
| 93 | 93 |
mEffects = new DistortedEffects(); |
| 94 | 94 |
mEffects.apply( new MatrixEffectQuaternion(quatInt2, center) ); |
| ... | ... | |
| 151 | 151 |
if( checked ) mSinkAssociation |= n; |
| 152 | 152 |
else mSinkAssociation &= (15-n); |
| 153 | 153 |
|
| 154 |
mSink.setMeshAssociation(-1,mSinkAssociation);
|
|
| 154 |
mSink.setMeshAssociation(mSinkAssociation,-1);
|
|
| 155 | 155 |
} |
| 156 | 156 |
|
| 157 | 157 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 209 | 209 |
final float angleFaces = (float)((180/Math.PI)*(2*Math.asin(SQ3/3))); // angle between two faces of a tetrahedron |
| 210 | 210 |
final int MESHES=4; |
| 211 | 211 |
|
| 212 |
int association = 1;
|
|
| 212 |
int andAssoc = 1;
|
|
| 213 | 213 |
MeshBase[] meshes = new MeshTriangles[MESHES]; |
| 214 | 214 |
|
| 215 | 215 |
for(int i=0; i<MESHES; i++) |
| 216 | 216 |
{
|
| 217 | 217 |
meshes[i] = new MeshTriangles(5); |
| 218 |
meshes[i].setEffectAssociation(0,association);
|
|
| 219 |
association <<= 1;
|
|
| 218 |
meshes[i].setEffectAssociation(0,andAssoc,0);
|
|
| 219 |
andAssoc <<= 1;
|
|
| 220 | 220 |
} |
| 221 | 221 |
|
| 222 | 222 |
Static4D[] textureMaps = new Static4D[MESHES]; |
| ... | ... | |
| 267 | 267 |
VertexEffectDeform effect10= new VertexEffectDeform(dVec2, dRad, dCen2, dReg); |
| 268 | 268 |
VertexEffectDeform effect11= new VertexEffectDeform(dVec3, dRad, dCen3, dReg); |
| 269 | 269 |
|
| 270 |
effect4.setMeshAssociation(-1,14); // apply to mesh[1], [2] and [3]
|
|
| 271 |
effect5.setMeshAssociation(-1, 2); // apply only to mesh[1]
|
|
| 272 |
effect6.setMeshAssociation(-1, 4); // apply only to mesh[2]
|
|
| 273 |
effect7.setMeshAssociation(-1, 8); // apply only to mesh[3]
|
|
| 270 |
effect4.setMeshAssociation(14,-1); // apply to mesh[1], [2] and [3]
|
|
| 271 |
effect5.setMeshAssociation( 2,-1); // apply only to mesh[1]
|
|
| 272 |
effect6.setMeshAssociation( 4,-1); // apply only to mesh[2]
|
|
| 273 |
effect7.setMeshAssociation( 8,-1); // apply only to mesh[3]
|
|
| 274 | 274 |
|
| 275 | 275 |
result.apply(effect1); |
| 276 | 276 |
result.apply(effect2); |
Also available in: Unified diff
Update Myanmar flag.