Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Linking nightmare

Flea Cure
Registered User
Join date: 11 Jan 2006
Posts: 7
04-15-2006 02:20
Hello everyone,
I'm trying to complete my first scripting project which is an analog clock. I've got rotation working on the two clock hands by making an invisible prim as a pivot which contains the rotation script and linking it with the arm so that it rotates correctly. I've worked out the time and the arms use timers every 10 seconds for the hour and every second for the minute hands. The problem I'm facing now is that when I try and link the clock face with the two clock arms, my pivots are no longer the root prims and so they keep rotating but the arms stay static. I'm not sure how if there's a solution to this while still retaining my current rotation script. Someone suggested making a clock hand texture that was a disk but completely transparent but for the clock hand. And then using LLTargetOmega to rotate that from the base prim. I can go and implement this, will probably be a less resource hungary solution but out of interest I'd like to know if you can rotate one object around another even if they're not the base root of the object.

Regards

Flea Cure

I've attached an image of me proudly showing off my clock in Cordova sandbox.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
04-15-2006 02:36
It's a building trick you're after...

If you cut a box at 0.375 and 0.875 you get a box half the size. The centre of the actual prim is in the centre of the apparent face, so the hand will rotate (using local rotation llSetLocalRot() ) about it's apparent end.

I've never tried that I remember, but presumably 0.125 and 0.625 will also work.

You can also do it through "real" torture. Make you box prim a sphere. Dimple it 50%. Convert back to box (why don't they call it a cuboid, grr) and the "dimple" is magically preserved. You again get your apparent centre on the midpoint of one face.

You can also combine these if needed.