1
を働いていない私はfor
ループは、私が期待通りに動作していない何とかGLSL Sandboxで遊んでいます:GLSL - ループのため
float map(vec3 p)
{
p.yz = rotate(p.yz, mouse.y*10.);
float aa = 0.;
float b = box(p, vec3(1.,1.,1.));
for(int i=0; i<5; i++)
{
float off = float(i);
vec3 q = p+off*.05;//<--pivot go down diagonally
float c = box(q, vec3(off,1.,1.));//<--scale the box in x
aa = min(c,b);
}
return aa;
}
私はそれが、少なくとも5箱が徐々にxscale
が大きくなると下がる持つことを期待。しかし、結果は、ループの最後の結果ですべての重複ボックスが終了するように思えます。
どうすれば解決できますか?