PRIM POINT LIGHT/ja
Jump to navigation
Jump to search
JIRA で関連バグを検索する
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
LSL ポータル | 関数 | イベント | 型 | 演算子 | 定数 | 実行制御 | スクリプトライブラリ | カテゴリ別スクリプトライブラリ | チュートリアル |
解説
定数: integer PRIM_POINT_LIGHT = 23;integer 定数 PRIM_POINT_LIGHT の値は 23 です。
PRIM_POINT_LIGHT はプリムのポイント光の設定を調整するために使用されます。
llSetPrimitiveParams
[ PRIM_POINT_LIGHT, integer boolean, vector color, float intensity, float radius, float falloff ]• integer | boolean | – | TRUE ならば有効 、 FALSE ならば無効 | |
• vector | color | – | RGB の色 <R, G, B> (<0.0, 0.0, 0.0> = 黒, <1.0, 1.0, 1.0> = 白) | |
• float | intensity | – | 0.0 から 1.0 の範囲 | |
• float | radius | – | 0.1 から 20.0 の範囲 | |
• float | falloff | – | 0.01 から 2.0 の範囲 |
When used with llSetPrimitiveParams & llSetLinkPrimitiveParams
llGetPrimitiveParams
llGetPrimitiveParams([ PRIM_POINT_LIGHT ]);[ integer boolean, vector color, float intensity, float radius, float falloff ] のリストを返します。
• integer | boolean | – | TRUE ならば有効 、 FALSE ならば無効 | |
• vector | color | – | RGB の色 <R, G, B> (<0.0, 0.0, 0.0> = 黒, <1.0, 1.0, 1.0> = 白) | |
• float | intensity | – | 0.0 から 1.0 の範囲 | |
• float | radius | – | 0.1 から 20.0 の範囲 | |
• float | falloff | – | 0.01 から 2.0 の範囲 |
警告
光源は極力節約すようにしてください!Second Life ビューアは一度に 6 個以上描画することができません。また、それぞれの光源は描画ラグの原因となります。(OpenGL では 8 個まで可能ですが、SL はそれぞれを太陽と月のためによけておいているようです。)
複数の光源の効果をシミュレートしたい場合は、代わりに GLOW または FULL_BRIGHT の使用を検討してください。
関連記事
定数
• | CHANGED_SHAPE |
関数
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams | |||
• | llGetPrimitiveParams |
イベント
• | changed |
記事
• | LSL での色 |
サンプル
// 簡単な光源のデモ
// 8feb07 "tetsumo kuri"
// thanks to squee janitor for line to dissect
integer light_s = TRUE; // "_s" はステータスを示します
default
{
state_entry()
{
// llSetText("click me",<1,0,0.6>,.5); // ラベルが好きな人のために
}
touch_start(integer total_number)
{
if ( light_s )
{
light_s = FALSE;
// フルブライトは新しい(2006年版?)光モデルに何も関係ありません。
// しかし、見栄えをよくするためにフルブライトにしています。
llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);
llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, // これが FALSE なら、光はオフです。
<0.0,1.0,0.0>,1.0, 10.0, 0.5]); // 他のパラメタは関係ありません。
}
else
{
light_s = TRUE;
//llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]); //フルブライトはとりあえずコメントアウト
llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,
<1.0,0.7,1.0>, // 色のベクトル値の範囲: 0.0-1.0 *3
1.0, // 輝度 (0.0-1.0)
10.0, // 半径 (.1-20.0)
0.6 ]); // 弱まる (.01-2.0)
// これは1行で済ませることができなくもないです。このように。
//llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE,PRIM_POINT_LIGHT,TRUE,<1.0,1.0,0.5>,20,1.0,0.5]);
// ... だけどなんだか見づらいです ...
}
//llSay(0, " Click!");
}
}