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

  • Home
  • SEARCH
  • 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 7807633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:54:33+00:00 2026-06-02T02:54:33+00:00

I am attempting to string animations together using several CGAffineTransforms and CGAffineTransformConcats . The

  • 0

I am attempting to string animations together using several CGAffineTransforms and CGAffineTransformConcats. The overall goal I’m attempting to achieve is to make my image rotate 45 degrees while moving up 50 px then rotate another 45 degrees on its way back down.

 CGAffineTransform translateUp = CGAffineTransformMakeTranslation(0, -50);
    CGAffineTransform firstSpin = CGAffineTransformMakeRotation(M_PI_4);
    CGAffineTransform translateDown = CGAffineTransformMakeTranslation(0, 50);
    CGAffineTransform secondSpin = CGAffineTransformMakeRotation(M_PI_4);
    CGAffineTransform transform1 =  CGAffineTransformConcat(translateUp, firstSpin);
    CGAffineTransform transform2 =  CGAffineTransformConcat(translateDown, secondSpin);
    CGAffineTransform transformFull =  CGAffineTransformConcat(transform1, transform2);    
    [UIView beginAnimations:@"MoveAndRotate" context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
    [UIView setAnimationDuration:0.5];
    mainCharacterImage.transform = transformFull;
    [UIView commitAnimations];

Now mind you I am pretty new to everything CG related, but I don’t understand why this doesn’t work.

However I don’t consider to be the fact that this isn’t working to be the strange part, my question mainly is, can anyone explain to me why the above code causes my image to not only move up and rotate, but to move roughly 100 pixels to the right?

Any suggestions are very much appreciated!

  • 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-06-02T02:54:34+00:00Added an answer on June 2, 2026 at 2:54 am

    Because transformFull is the result of matrix multiplication of ((translateUp*firstSpin)*(translateDown*secondSpin)). Your animation goes directly from the start point to the result of calculating this matrix multiplication, which happens to be:

    0, 1, 0
    -1, 0, 0
    50 - 25 * sqrt(2), 25 * sqrt(2), 1
    

    This transformation matrix just happens to move the item about 100 pixels to the right.

    A transformation matrix has no history. It can’t tell what steps got it to that value and move through those steps. Instead you have to deliberately move to each step. Try to do this animation in two stages. Move the mainCharacterImage to transform1. Then move to a new transformation that is just a rotation of π/2.

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

Sidebar

Related Questions

I am attempting to retrieve jpeg and jpg files using the following statement: string[]
I'm attempting to create a list of objects using the variant boost. #include <string>
I am attempting to reverse a string without using the reverse function, classes and
I'm attempting to make a function that writes a string to the last line
I am attempting to parse a string like the following using a .NET regular
Using PHP I'm attempting to take an HTML string passed from a WYSIWYG editor
I'm attempting to make a function in Ruby that tells if a string is
I'm attempting to convert a string to a TStream. My code below gives me
I am attempting to compress a string via use of zlib (I've tried this
I am attempting to scan a string of words and look for the presence

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.