ジャンプ先: 概要. 戻り値. キーワード. フラグ. MEL 例.
colorAtPoint [-coordU float] [-coordV float] [-maxU float] [-maxV float] [-minU float] [-minV float] [-output string] [-samplesU uint] [-samplesV uint]
colorAtPoint は、取り消し不可能、照会不可能、および編集不可能です。
colorAtPoint コマンドは、UV 座標で渡したテクスチャ シェーダまたは海洋シェーダを照会するために使用します。(海洋シェーダの場合、UV はワールド座標空間の X と Z です)。戻り値は、渡した入力 UV 引数の数または照会された値によってサイズが決定される浮動小数点配列です。アルファ値のみ、RGB 値のみ、または RGBA 値を照会することができます。返される配列には単一のインデックスが付けられるので、RGB 値を指定した場合、赤の値のインデックスは index * 3 になります。青は index * 3 + 1、緑は index * 3 + 2 になります。RGBA 値では、3 の代わりに 4 の倍数を使用します。アルファ値のみの場合は、インデックスをそのまま使用できます。基本的な引数書式は 2 つあります。colorAtPoint -u 0 -v 0 -u .2 -v .1 など(すべてのポイントを記述)、または colorAtPoint -mu 0 -mv 0 -xu 1 -xv 1 -su 10 -sv 10 // 100 ポイントのサンプリング サンプリングするポイントが複数あり、それらがすべて正規のグリッド構造である場合は、後者の方法を使用してこのルーチンをコールする方がより効率的です。これは、UV 座標を並べた長い引数リストの代わりに、UV の最小/最大とサンプル数を使用します。
- 戻り値(-o A または RGB または RGBA)
- サンプリングする個々の UV 座標(-u float -v float)
- (-u と -v のコール数は一致している必要があります)
- サンプリングするポイントの均一なグリッド(-su int -sv int)
- (これを -u または -v と組み合わせて使用することはできません)
- サンプリング グリッドの境界(-mu float -mv float -xu float -xv float)
なし
texture, color, alpha, uv, ocean, outColor, paramUV
coordU, coordV, maxU, maxV, minU, minV, output, samplesU, samplesV
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
コマンド内でフラグを複数回使用できます。
|
// The return value is the array of values determined by the number of
// coord flag uses or samplesU * samplesV. The default return value is alpha.
// If instead the return value is RGB there will be 3 times as many values returned,
// and if it is RGBA there will be 4 times as many values.
createNode checker;
colorAtPoint checker1;
// returns the alpha value at uv (0.0,0.0) for texture checker1
// The return array will have one entry corresponding to this alpha.
colorAtPoint -u .5 -v .5 checker1;
// returns the alpha value at uv (0.5,0.5) for texture checker1
// The return array will have one entry corresponding to this alpha.
colorAtPoint -o RGB -u .5 -v .5 -u 0.0 -v 0.1 checker1;
// returns the colors at uv (0.5,0.5) and (0.0, 0.01) for texture checker1
// The return array will have 6 values in the following order: RGBRGB
colorAtPoint -o A -su 11 -sv 6 checker1;
// returns the alpha for 50 points in a uniform 11 by 6 grid mapped across
// uv (0.0, 0.0) to uv (1.0, 1.0) The 12th point would be the first point
// in the second row of samples where uv = (0.0, 0.2)
colorAtPoint -o A -su 3 -sv 3 -mu 0.3 -mv 0.3 -xu 0.4 -xv 0.4 checker1;
// returns the alpha for 9 points in a uniform 3 by 3 grid mapped across
// uv (0.3, 0.3) to uv (0.4, 0.4) The 4th point would be the first point
// in the second row of samples where uv = (0.35, 0.3).