Project

General

Profile

« Previous | Next » 

Revision d7829514

Added by Leszek Koltunski almost 4 years ago

1) Cube: convert it to the latest library. Main difference: objects are rendered better, individual cubits have rounded corners.
2) Examples: some adjustments to MeshJoin & Predeform
3) Library: fix a bug in main_vertex_shader's 'degree' function, which didn't work proprely in case of a vertex which was exactly at the center (i.e. vector PS was zero)

View differences:

src/main/java/org/distorted/examples/meshjoin/MeshJoinRenderer.java
86 86
      quatInt1.add(mQuat1);
87 87
      quatInt2.add(mQuat2);
88 88

  
89
      mSinkAssociation = 15;
89
      mSinkAssociation = 0;
90 90
      mSink = new VertexEffectSink( sink, center, new Static4D(0,0,0,0.75f) );
91 91
      mSink.setMeshAssociation(mSinkAssociation);
92 92

  
......
214 214

  
215 215
      for(int i=0; i<MESHES; i++)
216 216
        {
217
        meshes[i] = new MeshTriangles(10);
217
        meshes[i] = new MeshTriangles(5);
218 218
        meshes[i].setEffectAssociation(0,association);
219 219
        association <<= 1;
220 220
        }
......
267 267
      VertexEffectDeform effect10= new VertexEffectDeform(dVec2, dRad, dCen2, dReg);
268 268
      VertexEffectDeform effect11= new VertexEffectDeform(dVec3, dRad, dCen3, dReg);
269 269

  
270
      effect1.setMeshAssociation(15);  // apply to all 4 meshes
271
      effect2.setMeshAssociation(15);  // apply to all 4 meshes
272
      effect3.setMeshAssociation(15);  // apply to all 4 meshes
273 270
      effect4.setMeshAssociation(14);  // apply to mesh[1], [2] and [3]
274 271
      effect5.setMeshAssociation( 2);  // apply only to mesh[1]
275 272
      effect6.setMeshAssociation( 4);  // apply only to mesh[2]
276 273
      effect7.setMeshAssociation( 8);  // apply only to mesh[3]
277
      effect8.setMeshAssociation(15);  // apply to all 4 meshes
278
      effect9.setMeshAssociation(15);  // apply to all 4 meshes
279
      effect10.setMeshAssociation(15); // apply to all 4 meshes
280
      effect11.setMeshAssociation(15); // apply to all 4 meshes
281 274

  
282 275
      result.apply(effect1);
283 276
      result.apply(effect2);

Also available in: Unified diff