移動先: 概要 戻り値 キーワード. フラグ. 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 // samples 100 points
複数のポイントをサンプリングする場合で、それらがすべて標準のグリッド構造内にあるときは、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
ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
-output(-o)
|
string
|
|
|
出力するデータのタイプ:
A = アルファ値のみ
RGB = カラー値のみ
RGBA = カラー値とアルファ値
|
|
-coordU(-u)
|
float
|

|
|
テクスチャをサンプリングする U 座標を入力します。
|
|
-coordV(-v)
|
float
|

|
|
テクスチャをサンプリングする V 座標を入力します。
|
|
-minU(-mu)
|
float
|
|
|
デフォルトは 0.0 です。
サンプリングする U 方向の最小の境界です。
|
|
-minV(-mv)
|
float
|
|
|
デフォルトは 0.0 です。
サンプリングする V 方向の最小の境界です。
|
|
-maxU(-xu)
|
float
|
|
|
デフォルトは 1.0 です。
サンプリングする U 方向の最大の境界です。
|
|
-maxV(-xv)
|
float
|
|
|
デフォルトは 1.0 です。
サンプリングする V 方向の最大の境界です。
|
|
-samplesU(-su)
|
uint
|
|
|
デフォルトは 1 です。
U 次元でサンプリングするポイントの数です。
|
|
-samplesV(-sv)
|
uint
|
|
|
デフォルトは 1 です。
V 次元でサンプリングするポイントの数です。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: 1 つのコマンドで複数回使用可能なフラグ
|
// 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).