Rezzing pictures takes time and doesn't look nice. So why not overcome this problem:
CODE
// ============== Picture Viewer ================
// Rezzing the picture while you don't see it
//
// Create a 95% hollow box. On the inside repeat
// the texture 4 times and flip it horizontally.
// x=6.00, y=0.01, z=4.00
// ==============================================
integer Loop = 0;
integer NumberOfTextures;
integer Inside = TRUE;
float Time = 10.0; // Show a new picture every 10 seconds
default
{
state_entry()
{
// Activate the timer
llSetTimerEvent(Time);
// How many textures?
NumberOfTextures = llGetInventoryNumber(INVENTORY_TEXTURE);
}
timer()
{
// Show inside of the box?
if (Inside)
{
// Make the outside transparant so you see the inside
llSetAlpha(0,3);
// Put the new picked up picture on the transparant side
// You don't see the rezzing of the picture
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, Loop), 3);
// Change from inside to outside
Inside=FALSE;
}
else
{
// Make the outside opaque so you can see the picture on it
llSetAlpha(100,3);
// Because the outside is showed you cannot see the inside
// and you don't see the rezzing of the picture
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, Loop),5);
// Switch to inside for the next picture
Inside=TRUE;
}
// Increase the counter for the next picture from the content of the box
++Loop;
// No more pictures? Start at the beginning.
if (Loop == NumberOfTextures) Loop = 0;
}
changed(integer change)// There is a change in the object
{
if(change & CHANGED_INVENTORY) // Change in inventory?
{
// Get the (new?) number of pictures
NumberOfTextures = llGetInventoryNumber(INVENTORY_TEXTURE);
// And start showing them from the beginning.
Loop = 0;
}
}
}