Jump to content

Texture zoom script inverts picture


Sunbleached
 Share

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

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

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);  
    }
}

 

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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