|
Heather Rau
Registered User
Join date: 7 Feb 2007
Posts: 100
|
04-08-2007 08:11
I have a project that I am working on and am soliciting suggestions on the best way, or different ways to proceed.
In short, I have made a dance floor in the form of a cloud that adjoins the terrace off my skybox. It is composed of two sandwiched flat prims, both with the same cloud texture. The top one is about a foot above the bottom one and is set to phantom and partially transparent to give the illusion of depth to the cloud.
I would like to animate some "summer lightning" in the cloud. I have created the frames of the animation, approximately 10 different images, that show the lightning and cloud glow at various stages. I had anticipated inserting these as an animated graphic on the bottom prim. If necessary if file size is an issue, I would localize the animations and make several small prims that would sit directly atop the bottom prim and cut the animation into several discreet pieces.
Ideally, I would like have the animation be random and occasional to give it a more realistic effect. This makes this a scripting project as well. Any insight on how to accomplish this would be appreciated.
So some questions: 1) How do you make an animated tga file? I have tried using the following online tool but it fails on me. I'm not sure why--perhaps because the file is too big, which leads to my next question: 2) What is the maximum dimensional size, either absolute or practical, of an animated graphic? This is a function obviously of the original graphic and the number of frames. Where can I get info on this? 3) Any suggestions on an applicable script, or script fragment, to manage triggering the animation at random intervals bounded by a time frame?
Thanks in advance for any and all contributions.
|
|
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
|
04-08-2007 09:21
Animated graphics of the type you want to do are created with a texture set up with the individual frames arranged in columns and rows. You use a script that sets the tiling values according to the number of columns and rows and switches between frames by animating the offset values. The largest practical size for a texture is 1024x1024 so you could have either 16 256x265 frames, or 32 128x128 frames. The script for animating this way is very common. I also would love to know how to add randomness to the speed with which the frames cycle as it would be very useful to me for a similar project (displays that randomly break up with animated static). Not being a scripter I'm afraid I can't help you with that part.
_____________________
 My other hobby: www.live365.com/stations/chip_midnight
|
|
Heather Rau
Registered User
Join date: 7 Feb 2007
Posts: 100
|
04-08-2007 11:15
Thanks Chip, very helpful. The scripting aspect of it may be a bit more complicated, as what is required is for the script to execute at random intervals, but for the actual sequence of images to play through at the same rate (to ensure that it looks like lightning). In other words, I would want the script to execute at say a random interval somewhere between 10 and 25 seconds, but when it does execute, the (for example) 12 frames would play in rapid succession. I suspect you might want something similar for a static effect; you don't want it playing the actual static images at random intervals, you want the static EFFECT at random intervals.
If I gather any useful info I will post it back to this thread.
|
|
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
|
04-08-2007 12:37
You might be able to have the script cycle at a set rate but as part of each cycle randomly determine if the opacity gets set from 0 to opaque (and if it does gets switched back to 0 at the end of that cycle).
_____________________
 My other hobby: www.live365.com/stations/chip_midnight
|
|
Sylvia Trilling
Flying Tribe
Join date: 2 Oct 2006
Posts: 1,117
|
04-08-2007 13:57
Here is a script for a random eyeblink that you could adapt.
// This blink script uses a single texture with the frames set up as follows within the image. // // +-----+-----+ // | 1 | 2 | // +-----+-----+ // | 3 | 4 | // +-----+-----+
// The minimum time between blinks float minBlinkTime = 0.5; // in seconds
// The Maximum time between blinks float maxBlinkTime = 12.0; // in seconds
// The animation frame speed float animationSpeed = 7; // in fps
// number of frames in the animation integer numberFrames = 4;
// temporary variable float waitTime;
// Returns a reandom number between min and max float randBetween(float min, float max) { return llFrand(max - min) + min; }
default { // Main part of the program state_entry() { // Sets the size and position of the default frame llOffsetTexture(0.25,0.25,ALL_SIDES); llScaleTexture(0.5,0.5,ALL_SIDES); // Intialize time even llSetTimerEvent(randBetween(minBlinkTime,maxBlinkTime)); waitTime = (numberFrames * 2) / animationSpeed; } // Timer event timer() { // Temporarily turn off the timer event llSetTimerEvent(0.0); // Animate the eyes onces. llSetTextureAnim(ANIM_ON|PING_PONG,ALL_SIDES,2,2,1,4,animationSpeed); // Wait for the eyes to finish animating llSleep(waitTime); // Turn off animation llSetTextureAnim(FALSE,ALL_SIDES,2,2,1,4,animationSpeed); // Reset Timer for next event llSetTimerEvent(randBetween(minBlinkTime,maxBlinkTime)); } }
|
|
Chip Midnight
ate my baby!
Join date: 1 May 2003
Posts: 10,231
|
04-08-2007 14:12
Thanks Sylvia  I can definitely adapt that to what I wanted to do, and I think it's pretty much exactly what Heather needs as it is.
_____________________
 My other hobby: www.live365.com/stations/chip_midnight
|
|
Heather Rau
Registered User
Join date: 7 Feb 2007
Posts: 100
|
04-09-2007 13:32
DING DING DING we have a winner.  Thanks a bunch Sylvia! Heather
|
|
Sylvia Trilling
Flying Tribe
Join date: 2 Oct 2006
Posts: 1,117
|
04-09-2007 16:45
Let us know when and where you have the lightning set up. I would love to see it.
|