Jump to content

listing multiple sides/faces?


Lichee1488303381
 Share

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

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

Recommended Posts

You would simply have to apply it faca for face. llSetAlpha works for one or for all sides at a time You could use llSetLinkPrimitiveParamsFast, setting PRIM_COLOR several times. Here is a simple example that switches alpha on face 0 and 1

integer gfOn;default {	touch_end(integer num_detected) {		llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_COLOR, 0, llGetColor(0), gfOn, 
PRIM_COLOR, 1, llGetColor(1), gfOn] ); gfOn = !gfOn; }}

 

Link to comment
Share on other sites

to change more than one face, you need to use a loop?

        integer face;
        list faces = [2,4];
        integer len = llGetListLength(faces);
        integer n;       
        for(n = 0;n < len;++n)
        {
          face = llList2Integer(faces,n);
          llSetAlpha(0.0,face);
        }

Link to comment
Share on other sites

If you use a loop with llsetlinkprimitiveparamsfast or llsetalpha , you can get some prims displayed in one frame of the simulator and the others in the other frame .

 

Generally it s not annoying ( 1 frame is only 22 millisseconds) . But when there are are many datas sent between the simulator and the viewer , it could be noticed

But if you want to be sure your prims changed at the same frame , you need to use PRIM_LINK_TARGET

PRIM_LINK_TARGET is available for LlSetPrimitiveParams , LlGetLinkPrimitiveParamsLlSetLinkPrimitiveParamsFast

 

For your instance if you want to change to change the  face 2 and 4 you use

integer FACE_2 = 2; integer FACE_4 = 4;vector defaultColor = <1,1,1>;integer noLink = !!llGetLinkNumber();
float alphaValue = 0.5;llSetLinkPrimitiveParamsFast( noLink , [ PRIM_LINK_TARGET, noLink , PRIM_COLOR, FACE_2, defaultColor, alphaValue, PRIM_LINK_TARGET, noLink , PRIM_COLOR, FACE_4, defaultColor, alphaValue]);

 

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3625 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...