Jump to content

Texture Rotation


Cinder Darkheart
 Share

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

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

Recommended Posts

Tell us more about the texture animation you're already doing. Maybe there's some way to do whatever that is some other way, allowing you to use texture animation to do this smooth texture rotation effect. There's not much of an appealing substitute. You can certainly write a loop to spin a texture around and stop at a point -- that's easy, but it will not look "smooth" in the viewer because every cel of motion needs to be generated by the sim individually and shipped as an object update to the viewer, subject to network jitter, etc. (to say nothing of the script lag of the loop).

In some very simple cases, it's possible to rotate the whole object with llTargetOmega while animating the texture on some face of the object. This is almost certainly not going to work here, but we just don't know enough about this application to rule it out.

Link to comment
Share on other sites

I'm not quite understanding the application yet, and this sample code is very simplistic so I'm not sure this is useful, but here's a way to rotate a texture without using texture animation:


float textureRot = 0.0; // starting rotation

default
{
    state_entry()
    {
        llSetTimerEvent(0.1);   // seconds per update
    }
    timer()
    {
        textureRot += 0.02;  // step size (radians)
        if (textureRot > PI)    // max texture rotation
            llSetTimerEvent(0.0);   // stop rotating texture
        else
            llSetLinkPrimitiveParamsFast( 0,    // link number
              [ PRIM_TEXTURE, 0 // face to rotate texture on
              , TEXTURE_DEFAULT // texture (plywood for example)
              , <1,1,0> // repeats
              , ZERO_VECTOR // offsets
              , textureRot  // rotation (radians)
              ]);
    }
}

If you don't have the texture UUID, it's possible to do this with llRotateTexture() but only with a built-in minimum 0.2 second delay between updates.

Link to comment
Share on other sites

Thanks Qie I will give it a try, is add more detail to some prim water I'm making step one is down on getting the faces on the mesh right goal lol. step two is get the water to simulate wind blowing across the water. one thing I hated in all my years in sl water always see blah if you were using a prim for it. Just trying to make it more life like for me being I'm using specular mapping on my mesh to make it look that much sweeter!

Link to comment
Share on other sites

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