Change font size
It is currently Fri Aug 17, 2018 7:45 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: llSetTextureAnim
PostPosted: Sat Feb 02, 2008 9:07 pm 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
Function: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );

Animate the texture on the specified face/faces by setting the texture scale and offset
• integer mode – mask of Mode flags
• integer face – face number or ALL_SIDES
• integer sizex – horizontal frames (ignored for ROTATE and SCALE)
• integer sizey – vertical frames (ignored for ROTATE and SCALE)
• float start – Start position/frame number (or radians for ROTATE)
• float length – number of frames to display (or radians for ROTATE)
• float rate – frames per second (must not be zero)

start supports negative indexes.
If face is ALL_SIDES then the function works on all sides.
Frames are numbered from left to right, top to bottom, starting at 0.
If rate is negative, has the same effect as using the REVERSE flag.

Modes ↓ ↓ Description
ANIM_ON 0x01 Texture animation is on.
LOOP 0x02 Loop the texture animation.
REVERSE 0x04 Play animation in reverse direction.
PING_PONG 0x08 Play animation going forwards, then backwards.
SMOOTH 0x10 Slide in the X direction, instead of playing separate frames.
In both SCALE and ROTATE modes, causes smooth transitions.
ROTATE 0x20 Animate texture rotation.
Does not work with SCALE
SCALE 0x40 Animate the texture scale.
Does not work with ROTATE

Caveats

* The function silently fails if its face value indicates a face that does not exist
* You can only have one texture animation on a prim
o Calling llSetTextureAnim more than once on a prim will reset it.
* You cannot combine ROTATE and SCALE
* sizex & sizey are both limited to a range of 0 to 255


Examples

This slides a texture smoothly and loops it when it gets to the end.
{L_CODE}:
        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, 1);

This slides a texture smoothly in the opposite direction
{L_CODE}:
        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, -1);

This divides a texture into 64 "cells", 8 across, and 8 down, and flips through them, left to right, top to bottom. This is useful for cell animation.
{L_CODE}:
        llSetTextureAnim( ANIM_ON | LOOP, ALL_SIDES, 8, 8, 0, 64, 6.4 );

This rotates a texture counter-clockwise at 2 revolutions per second. Change the last value to -2*TWO_PI to rotate clockwise.
{L_CODE}:
        llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, 2*TWO_PI);

This scales a texture larger and smaller.
{L_CODE}:
        llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, 1, 1, 3, 2);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net