Project

General

Profile

« Previous | Next » 

Revision 663fea68

Added by Leszek Koltunski over 7 years ago

Some corrections for the new Noise, it is still fishy though (some suspicious loops form - see it with the ''Dynamics" example app, 2D, 3 points)

View differences:

src/main/java/org/distorted/library/type/Dynamic2D.java
392 392
                {
393 393
                time = noise(time,0);
394 394
              
395
                baseV[0][0] = next.x-curr.x;
396
                baseV[0][1] = next.y-curr.y;
395
                baseV[1][0] = next.x-curr.x;
396
                baseV[1][1] = next.y-curr.y;
397 397
   
398
                buffer[offset  ] = baseV[0][0]*time + curr.x +baseV[0][0]*mFactor[0];
399
                buffer[offset+1] = baseV[0][1]*time + curr.y -baseV[0][1]*mFactor[0];
398
                buffer[offset  ] = baseV[1][0]*time + curr.x +baseV[1][1]*mFactor[0];
399
                buffer[offset+1] = baseV[1][1]*time + curr.y -baseV[1][0]*mFactor[0];
400 400
                }
401 401
              else
402 402
                {
......
452 452
                  {
453 453
                  time = noise(time,vecCurr);
454 454

  
455
                  baseV[0][0] = (3*tmp1.a[0]*time+2*tmp1.b[0])*time + tmp1.c[0];
456
                  baseV[0][1] = (3*tmp1.a[1]*time+2*tmp1.b[1])*time + tmp1.c[1];
455
                  baseV[1][0] = (3*tmp1.a[0]*time+2*tmp1.b[0])*time + tmp1.c[0];
456
                  baseV[1][1] = (3*tmp1.a[1]*time+2*tmp1.b[1])*time + tmp1.c[1];
457 457
                 
458
                  buffer[offset  ]= ((tmp1.a[0]*time+tmp1.b[0])*time+tmp1.c[0])*time+tmp1.d[0] +baseV[0][0]*mFactor[0];
459
                  buffer[offset+1]= ((tmp1.a[1]*time+tmp1.b[1])*time+tmp1.c[1])*time+tmp1.d[1] -baseV[0][1]*mFactor[0];
458
                  buffer[offset  ]= ((tmp1.a[0]*time+tmp1.b[0])*time+tmp1.c[0])*time+tmp1.d[0] +baseV[1][0]*mFactor[0];
459
                  buffer[offset+1]= ((tmp1.a[1]*time+tmp1.b[1])*time+tmp1.c[1])*time+tmp1.d[1] -baseV[1][1]*mFactor[0];
460 460
                  } 
461 461
                else
462 462
                  {

Also available in: Unified diff