Jump to content

brightness and glowing of certain surfaces in this door script


ainst Composer
 Share

You are about to reply to a thread that has been inactive for 1855 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! I want to embed the brightness and glowing of certain surfaces in this door script to simulate the inclusion of light in the refrigerator.

It will be two prims - the refrigerator itself and the door. only two faces will be lit accordingly.

Advise how to do this?  and another question. Will it work if the fridge itself is part of the linket?

The script is written by the forum participant

string door_sound = "743e6ba4-65a8-d641-da12-6dc20e37eceb";

integer intSwing =90;
rotation rotSwing;
vector vOffset;

default{    

    state_entry(){
           rotSwing = llEuler2Rot(<0.0,0.0,(float)intSwing>*DEG_TO_RAD);  //90 degrees on the z axis       
           vector size = llGetScale();       
           vOffset = <(size.x*//0.5
           .45),(size.y*.5),1>;//open away from someone standing in front of face 2 -- that is, in front of the prim -- hinged on the left.    
       }    

        touch_start(integer total_number){
            llPlaySound (door_sound, 1.0);
            list l = llGetPrimitiveParams([PRIM_POS_LOCAL,PRIM_ROT_LOCAL]);
            vector v = llList2Vector(l,0);
            rotation r = llList2Rot(l,1);
            llSetPrimitiveParams([PRIM_POS_LOCAL,v+(vOffset-vOffset * rotSwing)*r,PRIM_ROT_LOCAL,rotSwing*r]);
            
            rotSwing.s*=-1;             
        }
}
 

 

Edited by ainst Composer
Link to comment
Share on other sites

1 hour ago, Rolig Loon said:

Actually, you don't even need a script to do this.  Fullbright and glow don't show through objects, so just put them on the inside of the refrigerator and keep the door shut when you don't want to see them.

697268315616cbb633b68c7d60e40156.gif

Yes, great idea, most likely I will do it! just wanted to add some realism.

Link to comment
Share on other sites

2 hours ago, Rachel1206 said:

Didi you try and search the wiki... the second sample on the page Category:LSL Light is and good example on how do implement this.

Replace ALL_SIDES in the sample with the face values of the inside of door and the inside of the refrigerator.

Thanks very much!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1855 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...