Jump to content
You are about to reply to a thread that has been inactive for 2610 days.

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

Recommended Posts

Posted (edited)

Hi.

am having a bit of trouble with KFM.

i am setting the starting trajectory of my fish as:

            llSetPos(home);
            llSetRot(llEuler2Rot(<0,15,90>*DEG_TO_RAD));
            r_6=<-8.0,0.0,2>;

this sets the fish pointing 15 deg up,

then the following KFM kicks in:

            r_6=<-8.0,0.0,2>;
            llSetKeyframedMotion([r_6, llEuler2Rot(<0, 0, 0> * DEG_TO_RAD), 5,
                <0,0,0>,llEuler2Rot(<0, 0, 90> * DEG_TO_RAD),2
                ],
                [KFM_MODE, KFM_FORWARD]);

after this, i notice that the the fish turns 90 to the left..which is what i want....BUT

the fish is tilted along the Y-axis. I have tried all sorts of angles to set the Y rotation to zero, but nothing seems to work.

how can i set the Y rotation to zero?

Edited by mansoor50
Posted

Note from the wiki:

Each keyframe is interpreted relative to the previous transform of the object.

So, when you issued your second KFM command, the object was already rotated 15 degrees on Y.  That's the starting rotation for the new keyframe. If you don't want that 15 degrees, you'll need to remove it explicitly, either by including a -15 degree rotation in Y in the new keyframe or by first introducing a quick 0.15 second keyframe that only does that single rotation.

Posted

Hi Rolig...

I changed my code as below:

llSetPos(home);
            llSetRot(llEuler2Rot(<0,0,90>*DEG_TO_RAD));
            r_6=<-8.0,0.0,2>;
            r_4=<0,-7,0>;
            llSetKeyframedMotion([<0,0,0>,llEuler2Rot(<0,15,0>*DEG_TO_RAD),1,
                r_6, llEuler2Rot(<0, 0, 0> * DEG_TO_RAD), 5,
                <0,0,0>,llEuler2Rot(<0, -15, 0> * DEG_TO_RAD),.15,
                <0,0,0>,llEuler2Rot(<0, 0, 90> * DEG_TO_RAD),.15
                ],
                [KFM_MODE, KFM_FORWARD]);
 

notice i put the 15 up within the KFM. the above is working fine EXCEPT that the fish is not pointing up. the fish remains "horizontal" and goes up.

You are about to reply to a thread that has been inactive for 2610 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
×
×
  • Create New...