Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

First Scripting Project, Having Trouble with Rotation

Sarina Crosby
Registered User
Join date: 8 Jan 2007
Posts: 1
09-06-2009 03:08
Please be gentle :)

For my very first scripting project I wanted to have basically a box spinning clockwise in the middle of four other boxes "orbiting" the center box in a counterclockwise motion. I thought I could achieve all of this with llTargetOmega, but apparently I was wrong. My approach to this was to have a center prim "hidden" and linked to the four boxes to handle their orbiting then create the clockwise orbiting box below and link them all together, the problem is when I link the 4 boxes and hidden prim to the clockwise root prim, everything starts turning together. Here's the script I'm using, pretty basic :)

default
{
state_entry()
{
llTargetOmega(<0,0,1>,PI,1.0);
}

}


I can easily get this to work as a two seperate objects, but that's the easy way out :) Thanks for the help on the front end.
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
09-06-2009 03:58
It's possible.

In the root prim, use:

llTargetOmega(<0.0, 0.0, 1.0>, orbital_speed, 1.0);

In the center cube which will also spin with the root, you must compensate. Use:

llTargetOmega(<0.0, 0.0, -1.0>, orbital_speed + own_speed, 1.0);

In the object I sent to you in-world, I set the speeds at PI_BY_TWO.