Jump to content
Sunbleached

Texture zoom script inverts picture

Recommended Posts

Hello! Here is such a script that allows to zoom in/out pictures, but there is a problem, it inverts the picture upside down. Is there a way to solve the problem, except how to turn the object itself?

default
{
        state_entry()
    {   
            llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, -1, -1, 0.5, 0.1);  
    }
}

 

Share this post


Link to post
Share on other sites

Try changing the negative values to positive?

Negative values in the texture edit window will flip it, so that may be why it's doing it here as well. I never really mess with the zoom feature of this function, and not in world to look at it.

  • Thanks 1

Share this post


Link to post
Share on other sites
2 minutes ago, Ruthven Willenov said:

Try changing the negative values to positive?

Negative values in the texture edit window will flip it, so that may be why it's doing it here as well. I never really mess with the zoom feature of this function, and not in world to look at it.

Hello! Thank you for your answer! Yes i did, replaced 1, -1, 1.0, 0.5, 0.1); value to positive and it inverted picture but it multiplies now... Is there another way?

Snapshot_001.png

Share this post


Link to post
Share on other sites
Posted (edited)
55 minutes ago, Ruthven Willenov said:

Try changing the negative values to positive?

Negative values in the texture edit window will flip it, so that may be why it's doing it here as well. I never really mess with the zoom feature of this function, and not in world to look at it.

Yes, texture rotation in a texture edit window seems the best way! Thank you!

Edited by Sunbleached

Share this post


Link to post
Share on other sites
Posted (edited)

What a backwards seeming function...

float start = 0.5;
float length = 0.5;
llSetTextureAnim(ANIM_ON | REVERSE|SCALE | SMOOTH|LOOP, // Note REVERSE
    ALL_SIDES, 0, 0, start, length, 0.25);

After a lot of trial and error (the wiki page doesn't explain anything beyond constants), I think I have this figured out. Kind of.

  • "start" and "length" are relative to the original size of the texture, at 1 x 1 repeats.
    • "start = 0.5" is the starting scale, 0.5 x 0.5 repeats.
    • "length = 0.5" is the transition distance.
    • 0.5 + 0.5 = 1.0 (ending scale)
    • Without REVERSE it'll transition from 0.5 to 1.0 (zoom out)
    • With REVERSE it'll transition from 1.0 to 0.5 (zoom in)
float start = -0.5;
float length = 0.5;
llSetTextureAnim(ANIM_ON | REVERSE|SCALE | SMOOTH|LOOP,
    ALL_SIDES, 0, 0, start, length, 0.25);
  • -0.5 + 0.5 = 0.0
    • Without REVERSE it'll transition from -0.5 (flipped) to 0.0
    • With REVERSE it'll transition from 0.0 to -0.5 (flipped)
  • -0.5 + 1.0 = 0.5 (normal)
    • Without REVERSE it'll transition from -0.5 (flipped) to 0.5 (normal)
    • With REVERSE it'll transition from 0.5 (normal) to -0.5 (flipped)
       
  • If start or length is greater than 1 (or -1), things scale linearly.
    • "start = 2" and "length = 1" just means that the ending scale is 3.0
  • Negative length seems to be the same as positive length.

I hope this ends up being helpful to someone.

Edited by Wulfie Reanimator
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thank you again so i just added PING_PONG to @Wulfie Reanimator version and now no need to rotate texture!

float start = 0.5;
float length = 0.5;
float speed = 0.1;

default
{

    state_entry()
    {   

llSetTextureAnim(ANIM_ON | REVERSE | SCALE | PING_PONG | SMOOTH | LOOP,
    ALL_SIDES, 0, 0, start, length, speed);      

    }
 }

Edited by Sunbleached

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