Change font size
It is currently Sat Apr 20, 2019 1:40 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: llsetkeyframedmotion problem
PostPosted: Sat Mar 16, 2019 7:51 am 

Joined: Thu Jun 16, 2011 11:29 am
Posts: 3
Hello all!

i have a quiestion, i have a disc and for this example i have 4 block at the every 90 Degree.
now i want to let rotate that disc and let it stop at every 90 degree and wait for a few seonds and then go further to the next 90 degree.

i did some tests with llSleep but when the llsetkeyframedmotion command is set the llSleep is running to, so that will not work proper.

is there any way to let my disc rotate and let it stop on the 90 degree and wait a few sec. and then next 90 degree?

it need to rotate smooth to.

This is not working the code here under

{L_CODE}:
default
{
    state_entry()
    {
        llSetKeyframedMotion([<0.0, 0.0, 0.0>, llEuler2Rot(<0, 0, 90> * DEG_TO_RAD), 5],[KFM_MODE]);
        llSleep(15);
        llSetKeyframedMotion([<0.0, 0.0, 0.0>, llEuler2Rot(<0, 0, 90> * DEG_TO_RAD), 5],[KFM_MODE]);
        llSleep(15);
        llSetKeyframedMotion([<0.0, 0.0, 0.0>, llEuler2Rot(<0, 0, 90> * DEG_TO_RAD), 5],[KFM_MODE]);   
    }
}


Top
 Profile  
 
 Post subject: Re: llsetkeyframedmotion problem
PostPosted: Sat Mar 16, 2019 8:30 am 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 166
Location: Belgium / Brussels
Try this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
}
Or this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;
integer loops = 20;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
       
        integer i;

        for(i = 0; i < loops; ++i)
        {
            llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
            llSleep(speed * sleep);
        }
    }
}
Or this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
   
    moving_end()
    {
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
}
Or this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
        llSetTimerEvent(0.1);
    }

    timer()
    {
        llSetTimerEvent(sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
}
Have fun! :)

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
 Post subject: Re: llsetkeyframedmotion problem
PostPosted: Mon Mar 18, 2019 4:11 am 

Joined: Thu Jun 16, 2011 11:29 am
Posts: 3
Thanks!!! i could use the code :) i did make it right working now !

Best Regards!

Repudiator

dj phil {L_WROTE}:
Try this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
}
Or this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;
integer loops = 20;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
       
        integer i;

        for(i = 0; i < loops; ++i)
        {
            llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
            llSleep(speed * sleep);
        }
    }
}
Or this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
   
    moving_end()
    {
        llSleep(speed * sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
}
Or this one:
{L_CODE}:
float speed = 1.0;
float sleep = 2.0;

default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
        llSetTimerEvent(0.1);
    }

    timer()
    {
        llSetTimerEvent(sleep);
        llSetKeyframedMotion([ZERO_VECTOR, llEuler2Rot(<0.0, 0.0, 90.0> * DEG_TO_RAD), speed], []);
    }
}
Have fun! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 3 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net