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 859 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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...