Jump to content
ainst Composer

brightness and glowing of certain surfaces in this door script

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites

Use llSetLinkPrimitiveParamsFast to toggle the glow and fullbright properties of the selected faces, depending on whether rotSwing.s is positive or negative.

  • Thanks 1

Share this post


Link to post
Share on other sites

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 1

Share this post


Link to post
Share on other sites

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

  • Like 1
  • Thanks 1

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...