Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llTextureAnim()

Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
06-03-2007 14:55
Is it just me or does llTextureAnim() insist on resizing and wrongly offsetting textures?

The set-up is this; I have a spherical part to a head (furry) with a four-frame eye blink texture. Now the, the eyes need to be scaled to 0.8, 0.7, rotated -90ยบ and with a base offset of 0.625, 0.4 (for the first-frame).

I'd hoped to use llTextureAnim() to then animate the frames forward and then back again under the impression it would simply add or remove 0.5 to the two offset values to achieve the animation. However, it messes, apparently eager to force the scale and offset to whatever it feels like, leaving me with beady little eyes that are in the wrong place.

Currently what I have instead is:

CODE
default {
state_entry() {
llOffsetTexture(0.625, 0.4, 1);
llSetTimerEvent(8.0 + llFrand(6.0));
}

timer() {
llOffsetTexture(0.125, 0.4, 1);
llOffsetTexture(0.625, 0.9, 1);
llOffsetTexture(0.125, 0.9, 1);
llSleep(0.1);
llOffsetTexture(0.625, 0.9, 1);
llOffsetTexture(0.125, 0.4, 1);
llOffsetTexture(0.625, 0.4, 1);
}
}


(excluding a little lag-checker which stops the blinking because it looks crap when it's lagging too much).

Anyone got any ideas how to recreate this using llTextureAnim() instead? Or is it just not going to work?
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
06-03-2007 16:15
From: Haravikk Mistral
However, [llTextureAnim()] messes, apparently eager to force the scale and offset to whatever it feels like
No, not "whatever it feels like", "whatever you tell it." llSetTextureAnim assumes the frames in your animation texture are tiled to exactly fill the number of rows and columns you tell it the texture has. If you tell it 2 rows and 2 columns, the scale will be < 0.5, 0.5 > and the offsets will be < 0.25, -0.25 >, < 0.25, 0.25 >, <-0.25, -0.25 > and < -0.25, 0.25 >, respectively. If the frames are not properly set up in the texture, it will have to be re-done and re-uploaded.