Jump to content

Rotate object in it´s own coordinates


gouldvoyage
 Share

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

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

Recommended Posts

Hi... my knowledge of scripting is really basic. I bought a script to rotate and it works perfectly. The things is when I edit/rotate to match the part of the avi in which I need this object to be the rotation follows the global coordinates no the local of the object.

 

In case it helps.... this is part of the script

 

default
    
    {
        state_entry()
        {
            llTargetOmega(<0,0,1>,speed,1.0);   
            
        }
        
        touch_start(integer total_number)
        {
            
            
            if(llDetectedKey(0)==llGetOwner() && OwnerOnly == TRUE) 
            {  
            
            speed += step;
            llTargetOmega(<0,0,1>,speed,1.0)

 

Thanks a lot.

Link to comment
Share on other sites

How is your object ? Linked  ? Attached ?

Many functions work differently if they are linked or not , are child or root prim , are attched or not

 

For instance , for llTargetOmega :

source http://wiki.secondlife.com/wiki/LlTargetOmega

 

  • If the script is attached to the root prim, the entire object rotates around the region axis
    • If the object is attached then it rotates around the attachment axis
  • If the script is attached to a child prim, the prim rotates around the local axis
    • A Child prim can rotate around its own axis while the entire object rotates around another axis.
  • Like 1
Link to comment
Share on other sites

Thanks for your reply... I´m really trying my best to understand as much as I can in that link.

My object is an avatar attachment.. is a machine gun attached to the pelvis, so what I want it to make it´s to spine around it´s own axis.

 

Sorry if I didn´t understand the question I´m really new to script and I´m reading as much as I can.

Link to comment
Share on other sites

It may have something to do with your object itself, or perhaps with the way the rest of your script is written -- the part that you didn't post earlier.  Try this....

Take a single prim, a cube with X=0.5, Y=0.25, Z=0.25, and drop this simple script in it.

default{    state_entry()    {        llTargetOmega(<1.0,0.0,0.0>*llGetRot(),2.0,0.2);    }}

 Attach it to your stomach.  It will spin around its own X axis and will keep pointing in whatever direction you face.  Now, if your object has more than one prim, the one that is supposed to spin has to be the root prim.  If it isn't, then yes, it will spin around the X-axis of the root. 

Link to comment
Share on other sites

Thanks again for your help. Even though it didn´t worked the way I wanted the previous scripted its very useful for me for not attached objects. When I have readed more about scripts and have more experience I´ll make more focused questions. Thanks a lot Rolig and Miranda.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4529 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...