Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Ocean Wave script/animation

Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
06-03-2009 19:08
Hi, I need a copy, mod, transfer script or animation for ocean waves. I need the waves to be small, like a small ocean that fits on about a 1000 m or less flat space. I cannot find one anywhere. Ive seen water, land pushers and water generators, water effects but I dont want to buy one till I know it will create waves. I have looked high and low and cant find anything. I hope you can help me or direct me to a tutorial on making them and what I would need to do that. Im desperate. ;)
Thanks
Kat
_____________________
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
06-03-2009 22:11
I can think of many ways to do it. One simple way would be to paint or photosource a wave texture (in Photoshop or your favorite graphics program) and apply it to the outside of a long, skinny cylinder. Your texture will need to have some transparency so that it looks like a breaking wave when you lay the cylinder down so that its Z-axis is horizontal. Then put a simple TargetOmega script into it, to make it rotate around the Z axis. Set it in the water and it should look fairly convincing.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
06-03-2009 22:15
Wow that doesnt sound too hard. I have looked at the shapes and all of waves I just didnt know what made them move and I dont know how to write a script for it. Thanks Rolig. ;)
I found the targetomega script, not sure how to use it though.
_____________________
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
06-04-2009 05:24
Just drop it in and stand back. If you play with it a bit, you can change the rate of rotation -- not at all difficult -- but other than that, there's nothing to it.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
06-04-2009 11:34
Ok, thank you. Ill be back and let you know what happens. I hope I can pull it off. ;)
_____________________
Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
06-06-2009 03:44
Hmmmm its not working very well for me. Keep in mind I havent done this to any great extent. Do I need to add pics to it too? I know thats probably a dumb question but I dont know.
_____________________
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
06-06-2009 07:01
Well, you obviously need to texture it in some way so what it looks like a breaking wave. You could either draw the texture or photosource it. Be imaginative.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
06-07-2009 00:31
Ok, how do I keep the entire prim from moving and just have the textures animated.
_____________________
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
06-07-2009 06:48
Ah... That's a different approach to the challenge. If you want to do it that way, you'd use llSetTextureAnim. That could work too, but it would involve doing a small amount of scripting. For the solution I suggested, the entire prim is supposed to rotate. If you have time, talent, and patience, you could try doing it both ways and see which one you like best .... or be inspired and imagine a new solution. ;)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
06-07-2009 07:17
BTW ... The reason I suggested rotating the entire prim instead of the texture is that llTargetOmega creates a smooth virtual rotation. Any other scripted method is going to move in discrete steps. That could look choppy unless you used MANY small steps ... which would be time-intensive. For example, llSetTextureAnim does allow for smooth animation (see ) but you'd have to do a lot of very tricky work with texture repeats and offsets to do it successfully. That's a lot of work for a simple wave.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Katnipsox Magic
Registered User
Join date: 8 Oct 2008
Posts: 116
06-10-2009 13:59
From: Rolig Loon
BTW ... The reason I suggested rotating the entire prim instead of the texture is that llTargetOmega creates a smooth virtual rotation. Any other scripted method is going to move in discrete steps. That could look choppy unless you used MANY small steps ... which would be time-intensive. For example, llSetTextureAnim does allow for smooth animation (see ) but you'd have to do a lot of very tricky work with texture repeats and offsets to do it successfully. That's a lot of work for a simple wave.

I do have a animated gif maker thats real good. I use Ulead. I never thought of making waves that way. Do you use an animated gif as a texture or do you create what you want size/shape wise and such then upload it to SL. I havent worked with animated gifs yet there but have extensive experience making them, not the actual drawing animation but editing and putting the clips together.
_____________________
Basement Desade
Registered User
Join date: 14 Jul 2006
Posts: 91
No gifs
06-10-2009 23:13
Rez a cylinder, put an alpha texture on each end, put a wave texture on the side, make a new script in the prim, delete the code and put this in it instead:

CODE


default
{

state_entry()
{
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, 1, 0, 0, 0, 0,0.3);

}


}


This will make the texture rotate around the outside of the prim, and replicate the movement of (identical) waves. (Or if it is a BIG cylinder, you could make a texture with several waves all in a row, that varied somewhat, and then place it so only one showed above the water at a time.)

The advantage of rotating the texture, rather than the whole prim, is that it allows you to flatten one side of the prim, making for lower, longer waves, without making a weird flapping thing.

You can control the texture animation speed with the number right at the end of the llSetTextureAnim line where it says "0.3);"

1.0); would be lots faster, 0.1); would be slower, for example.

It's simpler than you seem to be trying to make it. Don't make it more complicated than it has to be with things like gifs. :)
Brendan Etzel
Registered User
Join date: 22 Jul 2007
Posts: 33
06-11-2009 00:54
That is how I've done it so far...
You can even use a sculpty plane mesh to make one hell of a swell.
What's puzzling me still is how they make that foam swirling round a rock?
Is there some math involved to change the texture animation on the prim ?


Thanx
Basement Desade
Registered User
Join date: 14 Jul 2006
Posts: 91
06-11-2009 01:48
From: Brendan Etzel
That is how I've done it so far...
You can even use a sculpty plane mesh to make one hell of a swell.
What's puzzling me still is how they make that foam swirling round a rock?
Is there some math involved to change the texture animation on the prim ?


I've never done it, nor have I seen it, but were I to attempt it, I would use a simple texture rotation script on a sculpty that was textured with a foam texture. Or, if I wanted the texture to swirl first one way, and then the other, I would either do a sleep or a timer event to cause it to reverse directions.

I also might try rotating the prim itself as well as the texture, so the high and low places changed positions in the reverse rotation to the texture rotation, at a different rotation speed, so it looked random. The rotation direction could be controlled the same way as the texture rotation, but I doubt I would need to get quite that fancy. :)

Btw, a rippling river sculpty would probably work dandy for this.