// noise() (パーリンノイズ)の引数3つの場合のテスト // マウスカーソルのx,y座標でノイズの出方を変える PImage img; int nx; float ny, nz; void setup() { size(320, 320); img = createImage(width, height, RGB); frameRate(24); nz = 0.0; } void draw() { // background(0); nx = int(mouseX * 20 / (width - 1)); ny = (float(mouseY) / (height - 1)); noiseDetail(nx, ny); img.loadPixels(); for (float y=0; y < height; y++) { for (float x=0; x < width; x++) { float px = (x / (width - 1)) * 16; float py = (y / (height - 1)) * 16; float v = noise(px, py, nz); img.pixels[int(y * width + x)] = color(v * 255); } } img.updatePixels(); image(img, 0, 0); textSize(16); text("nx:ny:nz= " + str(nx) + " , " + str(ny) + " , " + str(nz), 10, 32); nz += 0.01; }