Jump to content

Script to make a moving mesh object


Laurent Bechir
 Share

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

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

Recommended Posts

When you write your script, I suggest using llSetLinkPrimitiveParamsFast in a timer event, scripted so that it cycles through the faces each time you trigger the timer, resetting all other faces to your default texture (TEXTURE_BLANK maybe).  So, for example, assuming that you have four faces numbered 0, 1, 2, and 3 and have defined a global integer counter ( iCount ) , you would have something that might look like:

timer()

    llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, TEXTURE_BLANK, <1,1,1>,ZERO_VECTOR, 0.0]);  // Sets all to default
    iCount = ++iCount%4;
    llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_TEXTURE, iCount, texture_UUID, <1,1,1>,ZERO_VECTOR, 0.0 ]);	// Sets target texture on face = iCount
}

 

Edited by Rolig Loon
  • Like 2
Link to comment
Share on other sites

1 hour ago, animats said:

For that, use llSetTextureAnim. Once started, any viewer passing by will run the animation smoothly without any server or LSL involvement.

No, not really...

What the op ASKED was how to toggle the textures on different faces of an object, to fake movement, this sort of thing is already pretty common in pre bento mesh tails for example, where the "Tail" is actually several different tails, each in a slightly different pose.

In that case llSetLinkPrimitiveParamsFast allows you to toggle the alpha on each of the 8 faces of each of the "8 faced mesh tail prims" so that only ONE mesh tail face is visible at any time.

What you are suggesting is placing an animated texture on a single face, because...

You didn't bother to read the damn question.
 

  • Like 2
Link to comment
Share on other sites

If the mesh was a single faced, uv fixed link, you could use llSetLinkTextureAnim() to "slide" a portion of an alpha texture across the uv's that expose said portion per frame.

 https://i.imgur.com/af9qFey.gif

This example is not "update heavy" as its just an animated texture. You still have to have the topology in place and are severely limited on texturing options.

Edited by Lucia Nightfire
Link to comment
Share on other sites

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