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 618433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:32:42+00:00 2026-05-13T18:32:42+00:00

I am trying to rotate my object like shakes dice. please suggest simplest way

  • 0

I am trying to rotate my object like shakes dice.
please suggest simplest way to implement it in my iphone application.
Any kind of sample code or documentation.

  • 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-13T18:32:42+00:00Added an answer on May 13, 2026 at 6:32 pm

    If you want to do this without using OpenGL you can use a UIImageView and the set a series of animation images. By creating a series of images you can create a “rolling dice” effect. Here is an example of how to do this:

    // create a UIImageView
    UIImageView *rollDiceImageMainTemp = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"rollDiceAnimationImage1.png"]];
    
    // position and size the UIImageView
    rollDiceImageMainTemp.frame = CGRectMake(0, 0, 100, 100);
    
    // create an array of images that will represent your animation (in this case the array contains 2 images but you will want more)
    NSArray *savingHighScoreAnimationImages = [NSArray arrayWithObjects:
                                                    [UIImage imageNamed:@"rollDiceAnimationImage1.png"], 
                                                    [UIImage imageNamed:@"rollDiceAnimationImage2.png"], 
                                                    nil];
    
    // set the new UIImageView to a property in your view controller
    self.viewController.rollDiceImage = rollDiceImageMainTemp;
    
    // release the UIImageView that you created with alloc and init to avoid memory leak
    [rollDiceImageMainTemp release];
    
    // set the animation images and duration, and repeat count on your UIImageView
    [self.viewController.rollDiceImageMain setAnimationImages:savingHighScoreAnimationImages];
    [self.viewController.rollDiceImageMain setAnimationDuration:2.0];
    [self.viewController.rollDiceImageMain.animationRepeatCount:3];
    
    // start the animation
    [self.viewController.rollDiceImageMain startAnimating];
    
    // show the new UIImageView
    [self.viewController.view addSubview:self.rollDiceImageMain];
    

    You can modify the creation and setup including the size, position, number of images, the duration, repeat count, etc as needed. I’ve used this feature of UIImageView to create simple animation effects and it works great!

    Please let me know if you try this and if it works for your needs. Also, post any follow up questions.

    Bart

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

Sidebar

Related Questions

I'm trying to rotate a UIView object like shown on the image below http://i.piccy.info/i7/f8ff7fe488c7c492e6ff6a689bc9cdeb/1-5-2127/60800682/rotation.png
(iPhone) I'm trying to make it so that the user can rotate an object
I am trying to make a very simple object rotate around a fixed point
I'm trying to figure out how to rotate a single object on an html
I'm trying to rotate an SVG <polygon> (or any other element) using this: var
I have been trying to create rotating object using jQuery and without any other
So I've got an object I'm trying to rotate according to a Yaw, Pitch
I'm trying to rotate a 3D object on its Z axis (up/down). public void
I am trying to find a method which will rotate an object to make
I'm trying to make an object rotate faster and faster as time goes on,

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.