Jump to content

Keeping rotating linked prims stationary


Reo Ninetails
 Share

You are about to reply to a thread that has been inactive for 3745 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello again! To start off, I am still really new to scripting, so you might have to put things extreamly simple.

I made an object out of three prims. each prim is rotating at a different speed around the center and are linked together.

In the end I am going to need to l have this object attached to a body part, i.e hand. and the top of the object will always need to be facing the palm.  The problem I am having right now is that, while the linked objects are upright, they rotate just fine, but when I tilt it sideways, the whole object slowly starts rotating while the actual linked prims are rotating.

I haven't actually tried attaching the object to me yet, but I assume it's going to do this still if I do since I don't know how to

control scripts very well yet.

So again, I need help getting the whole object to not rotate while the 3 individual linked prims continue to.

 

I hope this makes sense.

 

On another note, would it be better/easier to have the prim rotate, or the texture on the prim?

 

This is the basic script I have in each linked prims right now.

Please help me get started in the right direction!

 

default
{
state_entry()
{
//Each prim has a different speed.
llTargetOmega(<0,0,1> * llGetLocalRot(),PI,1.0);
}

}

Thank you for your time!

Link to comment
Share on other sites

Your script is fine, but you don't need three copies.  One will do.  If I understand correctly, you have three prims all rotating around a common axis, sort of like having three turntables stacked on top of each other, but all going at different speeds.  If that's the case, your one script can look sort of like this...

default{    state_entry()    {        llSetLinkPrimitiveParamsFast(1,[PRIM_OMEGA,<0,0,1> * llGetLocalRot(),PI,1.0]);        llSetLinkPrimitiveParamsFast(2,[PRIM_OMEGA,<0,0,1> * llGetLocalRot(),PI/2.0,1.0]);        llSetLinkPrimitiveParamsFast(3,[PRIM_OMEGA,<0,0,1> * llGetLocalRot(),PI/3.0,1.0]);    }}

 When you attach that to your hand (or wherever), the three prims should rotate properly relative to the attachment point. 

 

  • Like 1
Link to comment
Share on other sites

Ok, I guess the next question to ask is how to set the prims up so they all rotate with the same center point.

 

RIght now I have 3 hollow cylinders a center one, one slightly bigger , and one bigger than both, all in the same spot so the textures are layered.. The bottom of each are tapered in to make them a cone shape. 

Do I need to put an invisible prim in the center for them to use as a center point?

Link to comment
Share on other sites

You don't need to hollow or taper anything unless you really want to.  Just rez a cylinder.  Drag/copy it and move it up on Z.  Repeat, so you now have three cylinders all with the same Z axis.  Decrease the diameters of the second and third ones and then squish the full set along Z to your desired length.  Link and activate.

Link to comment
Share on other sites

LOL... Time to start experimenting.  You have the basic rotating unit now.  Try linking several of those units to a single prim that will be the root prim of the larger linkset.  You'll have to start watching out for link numbers because they will change as you enlarge the linkset but you should still be able to use one script to control them all.  Enjoy.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3745 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...