Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Slowly rotating object on water?

Wendel Gascoigne
Registered User
Join date: 19 May 2005
Posts: 226
08-01-2006 02:24
I'm sure this has been done many times before but I'm very new to scripting in LSL (although a developer in C++ and C# in real life so not so worried about understanding the LSL syntax, event handling, ...).

I want to help my partner animate some objects she has made for our pool. She is the artist, I think I'm supposed to be the coder. :)

What I'd like is to similate a bit of water drift in the pool with some objects and have people lying on an inflatable mattress rotate one way then another.

Is this something for I would use llTargetOmega() and random intervals at which to reverse the rotation? Would that work with an avatar lying on the inflatable mattress?

If you have any suggestions or samples I could look at for my initial attempts at scripting this behaviour, your help would be most appreciated.

Many thanks,
Wendel
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
08-01-2006 02:49
I think most similar matresses use llTargetOmega however they sustain a constant circular motion. If you wish it to rotate c/w then anti-c/w you'll need to set the rotation otherwise the matress will "jump" to position it was at before llTargetOmega was called.

Theres a good thread somewhere, lost in the depths of time, I'll try and dig it out, which explains this and gives examples which you should find easy to apply.

EDIT:
This looks like the one I was thinking of:
/54/31/69230/1.html
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Wendel Gascoigne
Registered User
Join date: 19 May 2005
Posts: 226
08-01-2006 02:54
Thanks for the quick reply and the link to the sample code. Much appreciated.

It all looks a bit involved and mysterious. Looks like I'll have to experiment and curse a bit tonight. :)

Wendel
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
08-01-2006 03:18
If you sit on something rotating with a llTargetOmega you do appear to spin, somewhere I have pictures of someone spinning whilst sat on a windmill blade I made this way.

There can be issues with using llTargetOmega though. I made a spinning seat, so you could sit and watch the landscape swing by. Obvious first approach, llTargetOmega. Downside, every time anyone sat on the seat started typing (changed anim for that was the target I think), or someone else sat down or stood up the client "snapped" back to the start position and started the spin again. Not good if you want to sit and chat to someone.

I ended up (sadly) going with physical rotations as the only way. Of course it wasn't doing that much, so it worked pretty smoothly and wasn't a real load on the sim, so a couple of loungers would probably be OK. This approach would also let you have the objects drift a little around on the water. It would also be possible, although I'm not sure how much of a saving in sim load, to use Jesrad's non-physical movement scripts for this. That's way over-tooled at the moment for your needs, but the central concept of a family of scripts handling the movements (rotations or translations) with a timer system so you get an update every 0.05s rather than 0.2s is good for this.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Wendel Gascoigne
Registered User
Join date: 19 May 2005
Posts: 226
08-01-2006 03:25
Thanks Eloise. Some very interesting points for me to consider in your post.

The plot thickens. Looks like I have chosen an interesting topic for my first script. :D

Wendel