Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6349467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:37:20+00:00 2026-05-24T21:37:20+00:00

I am creating a sequence of actions as play back to recorded gestures. If

  • 0

I am creating a sequence of actions as play back to recorded gestures. If I only pan the sequence it plays at full speed. If I only rotate, it plays at full speed. If I only scale it plays at full speed. If, however, I pan then rotate, rotate plays back about half speed. If I rotate then pan, pan runs at about half speed. Here is the play function. RecordData is just an object with the time, position, rotation, scale information.

-(void) Play
{
    int count = [m_MoveTos count];
    if (count < 2)
    {
        return;
    }

    [m_Actor stopAllActions];
    [m_Actions removeAllObjects];

    RecordData* start = [m_MoveTos objectAtIndex:0];
    m_Actor.position = start.Pos;
    m_Actor.rotation = start.Rotate;
    m_Actor.scale = start.Scale;
    NSLog(@"Starting with %d nodes.", [m_MoveTos count]);
    NSLog(@"Actor Start Position:%f, %f Rotation:%f, Scale:%f", m_Actor.position.x,     m_Actor.position.y, m_Actor.rotation, m_Actor.scale);

    float lastTime = 0;
    RecordData* lastData = start;

    //Skip start
    for(int i = 1; i < count; ++i)
    {
        bool delay = true;
        RecordData* rData = [m_MoveTos objectAtIndex:i];
        float delta = rData.Time - lastTime;

        if(rData.Pos.x != lastData.Pos.x || rData.Pos.y != lastData.Pos.y)
        {
            CCAction* moveAction = [CCMoveTo actionWithDuration:delta     position:rData.Pos];
            [m_Actions addObject:moveAction];
            delay = false;
        }

        if (rData.Rotate != lastData.Rotate)
        {
            // Put this in Record data
            float degrees = rData.Rotate;
            int sign = degrees/ABS(degrees);
            degrees = ABS(degrees);
            while (degrees > 360) 
            {
                degrees -= 360;
            }
            degrees *= sign;
            NSLog(@"Rotation %f", degrees);
            CCAction* rotAction = [CCRotateTo actionWithDuration:delta     angle:degrees];
            [m_Actions addObject:rotAction];
            delay = false;
        }

        if (rData.Scale != lastData.Scale)
        {
            CCAction* scaleAction = [CCScaleTo actionWithDuration:delta     scale:rData.Scale];
            [m_Actions addObject:scaleAction];
            delay = false;
        }

        if(delay)
        {
            CCActionInterval* delayTime = [CCDelayTime     actionWithDuration:delta];
            [m_Actions addObject:delayTime];
        }

        delay = true;
        lastTime = rData.Time;
    }

    if([m_Actions count] < 2)
    {
        return;
    }

    CCAction* seq = [CCSequence actionsWithArray:[m_Actions getNSArray]];
    [m_Actor runAction:seq];
}

Is there something I’m missing?

Thanks,
Jim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:37:22+00:00Added an answer on May 24, 2026 at 9:37 pm

    Mixing action types seems to be the problem. I now have a different action sequence for position, rotation, and scale. It runs fine now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I stuck into creating an XSD schema allowing only next sequence of elements: <root>
I want to create a sequence without creating a model Foo : let( :foo_id
Has anyone got any example code for creating a unique number sequence to be
I am creating a simple splash page with the following sequence: Fade in elements
Is there a way to creating an observable from a sequence in F#? The
I am creating a sequence as a [Integer] in Haskell. The mathematical definition of
I'm creating a sequence diagram, and one of the classes is being observed by
How would i go about creating an image sequence with core animation. I would
What's a good workflow (usage procedure) for creating a UML Sequence diagram in Dia?
As the title says, when creating a multidimensional sequence in scala with tabulate, is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.