Jump to content

llSetTextureAnim versus changing the offset manually on a timer


Vulpinus
 Share

Recommended Posts

What's prompted this is I bought something on the MP, with no inworld demo, and there's a problem with it*. So, I'm trying to recreate my own version from it.

It's a 'simple' flying animated texture, crows in this case. A texture on the usual wavy circularish sculpt to make the wings animate. But...

There are four crows on each sculpt. The texture only has one crow. If I put the texture on the sculpt, it looks badly stretched unless I set the horizontal scale to 4, then it looks right (like the original, which is quite nice). Using llSetTextureAnim sets the multiple back to one though, so this is clearly not the way it is done on the thing I bought. Unless I'm missing something about using llSetTextureAnim. Am I?

For clarity, this is my code:

llSetTextureAnim(1 | LOOP | REVERSE | SMOOTH , ALL_SIDES, 1, 1, 0.0, 1.0, 0.05);

The only other way I can think of is continually sliding the texture offset (with llSetLinkPrimitiveParamsFast) on a timer, to avoid using llSetTextureAnim and keep the four crows.

Surely this is a nasty thing to do to the server, and my bandwidth... isn't it?

Is there another way to do this?

 

*Yes, I have tried to contact the maker, I'll wait and hope for a while for a response.

Link to comment
Share on other sites

Yeah, it would be pretty awful to use manual texture offsets.

There's a very old bug that reportedly causes animated textures to revert to 1x1 repeats, but if it weren't for that, you can animate a texture with the currently set repeats, by using 0 as the SizeX and SizeY arguments to llSetTextureAnim. So, unless / until the bug kicks in, you might get what you want using something like:

default{    state_entry()    {        llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 0.0);        llScaleTexture(4.0, 1.0, ALL_SIDES);        llSetTextureAnim(ANIM_ON | LOOP | REVERSE | SMOOTH, ALL_SIDES, 0, 0, 0.0, 1.0, 2.0);    }}

 ... where you could replace llScaleTexture() with a manual setting of texture repeats (as long as the texture isn't already animated).

  • Like 1
Link to comment
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.

 Share

×
×
  • Create New...