Changeset 3724


Ignore:
Timestamp:
Dec 25, 2014, 4:59:26 PM (7 years ago)
Author:
sam
Message:

test: add 7-dimensional simplex noise test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/test/simplex.cpp

    r3722 r3724  
    3333    simplex_interpolator<2> s2;
    3434    simplex_interpolator<3> s3;
    35     simplex_interpolator<4> s4;
     35    simplex_interpolator<7> s7;
    3636
    3737    for (int j = 0; j < size.y; ++j)
    3838    for (int i = 0; i < size.x; ++i)
    3939    {
     40        float x = (float)i, y = (float)j;
    4041        float sum = 0.f;
    4142        int maxoctave = (j < size.y / 2) ? 1 : (1 << octaves);
     
    4445        {
    4546            if (i < size.x / 3)
    46                 sum += 0.5f / k * s2.Interp(zoom * k * vec2(i, j));
     47                sum += 0.5f / k * s2.Interp(zoom * k * vec2(x, y));
    4748            else if (i < size.x * 2 / 3)
    48                 sum += 0.5f / k * s3.Interp(zoom * k * vec3(i, j, 0.0f));
     49                sum += 0.5f / k * s3.Interp(zoom * k * vec3(x, y, 0.f));
    4950            else
    50                 sum += 0.5f / k * s4.Interp(zoom * k * vec4(i, j, 0.0f, 0.0f));
     51                sum += 0.5f / k * s7.Interp(zoom * k * vec7(x, 0.f, 0.f, 0.f, y, 0.f, 0.f));
    5152        }
    5253
Note: See TracChangeset for help on using the changeset viewer.