Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Syncronised Rotation ?

Tazmania Trefusis
Registered User
Join date: 13 Jan 2008
Posts: 85
02-07-2010 14:00
I'm looking for a '2 x rotating objects in sync' script.

Like you would use for 2 rotating cogs, 90 deg to each other and must be in sync with eachother (in ref to the teeth).
I wont be using cogs or teeth etc but it's the nearest example that I could explain. I just want to be able to rotate 2 objects, angled at 90 degrees (or should work at any angle!) and to rotate at the same time, same speed and one not get ahead of the other. They will be textured and markings on the texture will need to be in same position on both rotating objects at same time.

Anyone have any ideas? I don't script so will be looking to buy said script or even better if it was public domain. This is for a personal build but could end up as a sellable build. Scripts can be nomod if need be but I would like to be able to change the speed at least

Taz
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
02-07-2010 14:43
Take a look at http://wiki.secondlife.com/wiki/LlSetTextureAnim. That's probably the best way to do what you want. It has the advantage of making smooth rotations, as opposed to the choppy ones you get if you keep resetting the rotation of your gear objects with a timer. Also, you can easy adjust the rate of rotation with its final parameter. This should make it fairly easy to keep your gears going the same speed. The one big limitation is that texture animation is a client-side effect, so different people watching the rotation at the same time will see your gears at different apparent positions. That may make true synchronicity tough to do.

The other way to do the same thing is to actually rotate the two prims by resetting their positions incrementally. That involves a bit of math (see http://wiki.secondlife.com/wiki/User:Void_Singer/Rotations), and can be tricky. The big limitation here, as I said above, is that you can't get a nice smooth rotation. Even if you rotate in small increments -- a potentially laggy proposition -- the rotation will appear choppy.
_____________________
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