tips mainly for Houdini


float sum=0;

for(int i = 0; i < ch("folder2"); i++)
{
    sum += ch("probability" + itoa(i + 1));
}

float rand = rand((@id + ch("seed")+0.21) + (ch("seed")));
rand = fit01(rand, 0, sum);


sum = 0;
for(int i = 0; i < ch("folder2"); i++)
{
    sum += ch("probability" + itoa(i + 1));
    if(rand<sum)
    {
        i@atr = chi("atr" + itoa(i + 1));
        break;
    }
}





"probability" parms are actually proportion. In this photo, each of them is set to 1, which means both are equally and randomly picked up.
タグ

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

管理人/副管理人のみ編集できます