[範例] 發光物件腳本


Second Life中文指南 http://www.secondlifecn.com/ 第二生命 第二人生_Second Life_ChinaQ_HiPiHi玩家基地 查看完全版 查看精简版
 提醒您:如果本页图片或Flash动画无法正常显示,请点击这里访问原帖。
[範例] 發光物件腳本 作者:NidgetGod 时间:2008-2-2 15:23:15 1
以下腳本取自 Second Life WikiPRIM_POINT_LIGHT 範例

// simple light source demonstrator
// 8feb07 "tetsumo kuri"
// thanks to squee janitor for line to dissect

integer light_s = TRUE; // "_s" for status

default
{
state_entry()
{
// llSetText("click me",<1,0,0.6>,.5); // in case you like labels
}

touch_start(integer total_number)
{
if ( light_s )
{
light_s = FALSE;

// fullbright doesn't have anything to do with light in NEW(2006?) lighting model
// setting fullbright does look good though
llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);


llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, // if this is false, light is off,
<0.0,1.0,0.0>,1.0, 10.0, 0.5]); // rest of params don't matter
}
else
{
light_s = TRUE;
//llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]); //leave fullbright commented for now
llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,
<1.0,0.7,1.0>, // light color vector range: 0.0-1.0 *3
1.0, // intensity (0.0-1.0)
10.0, // radius (.1-10.0)
0.6 ]); // falloff (.01-1.0)


// this could have been done in one line, like this
//llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE,PRIM_POINT_LIGHT,TRUE,<1.0,1.0,0.5>,20,1.0,0.5]);
// ... but thats kinda hard to take in...
}
//llSay(0, " Click!");
}
}
[align=right][color=#000066][此贴子已经被作者于2008-2-2 15:31:37编辑过][/color][/align]
作者:kangjinwen 时间:2008-2-10 15:53:06 2

需要点击么?

作者:xinny 时间:2008-5-22 22:48:49 3
好象...很复杂
作者:lingxixue 时间:2008-6-5 22:03:38 4

[em08]

这是格式吗~~~~~~~~~~~~~~~~~~

所属版面:制造&脚本 本主题第1页
共有回复: 3 共有页数: 1 显示主题数:50     说买网 免费购物 U盘生产厂家