I have an image of globe which I want to rotate continuously around Y-axis. I also want to simulate it as an 3D rotation. I found some code using CABasicLayer and CALayer, but they rotate an image around Z-axis.
How to rotate a image (globe) around Y axis?
961 Views Asked by Geek At
2
There are 2 best solutions below
0
Geek
On
I end up using this because I need different views of globes. All images are view of globe taken from different angle. Here there are just 5 images but in actual I'll use around 36 images, because images will have 10 as difference of angle. Thus, 360/10 = 36.
UIImage *image = [UIImage imageNamed:@"globe.png"];
UIImage *image1 = [UIImage imageNamed:@"globe1.jpeg"];
UIImage *image2 = [UIImage imageNamed:@"globe2.jpeg"];
UIImage *image3 = [UIImage imageNamed:@"globe3.jpeg"];
UIImage *image4 = [UIImage imageNamed:@"globe4.jpeg"];
NSArray *imageArray = [NSArray arrayWithObjects:image, image1, image2, image3, image4, nil];
// set array of images, you want to cycle, to "animationImages" property.
self.imageView.animationImages = imageArray;
//duration of the animation-cycle
self.imageView.animationDuration = 2.0;
// 0 for endless repeation
self.imageView.animationRepeatCount = 0;
//starts the animation
[self.imageView startAnimating];
Related Questions in OBJECTIVE-C
- How to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
Related Questions in IOS6
- How to create an Objective-C project in an old version
- Is it possible to force Ios browser focus from input to another element?
- When was libc++ introduced in iOS?
- Require Xcode version to develop iOS 6 applications for iPad 4th Gen
- Swift - Make a Slide to Unlock like button in iOS 6
- Multiple versions for different iOS versions as one application
- How to detect iOS version in Objective C?
- Swift 3 Segue Q!- Prototype Cell to Multiple VCs - Using didSelectRowAtIndexPath
- Can I still develop apps for iOS6 in 2017?
- how to gat a value from an array which contain in an object and object already in an array while using json response?
- Programatically adding a iOS 6 look alike gradient UIButton
- I want to display device contact user
- How to create circle shape UITableView in iOS?
- I'm getting in this program stack or it stops to work
- How to keep iphone anonymous from iOS app?
Related Questions in UIIMAGEVIEW
- Changing the color UIImage
- UIScrollView automatically scrolls UIImageView to top on pinch-to-zoom
- Padding around UIImage in a UIImageView with a background color
- After UIImage rotation white lines appear
- Why CGImage size changed after resize with transparent background? And how to lower the memory cost?
- iOS - Obtaining localised system image
- Increasing memory usage in iOS using a UISlider to update a UIImageView's image
- UIImageview is not scaling to its frame when image is set
- Cannot force image to be rounded in custom UIImageView
- swift: load UIImage from local path
- How do I make several ImageViews scale based on the screen size without changing their position relative to each other?
- PNG images render incorrectly in running iOS app
- Collectionview cells are not showing according to screen width
- UIImage Sizing in Dynamic Collection View Cell with Autolayout and UICollectionViewCompositionalLayout
- imageView.layer.origin not working correctly in UIPageViewController's first view controller
Related Questions in UIIMAGE
- UIImage Resizing Works, but Reverts to Original Size When Converted to Data for Upload
- Fail to Upload an Image into Firebase Storage
- Is there a way to actually change the background color in UIImage.SymbolConfiguration of a system image? Or is it always clear?
- Check in UIImage.init existence of image in bundle
- How to compress Image without losing metadata?
- setup all of the properties of the stack view
- Changing the color UIImage
- UIImage in Swift only loads after triggering twice
- Cannot generate image which is then shared
- Memory leak issue trying to combine [UIImage] to single GIF image
- Padding around UIImage in a UIImageView with a background color
- Add an image to a subclass of UIVIew
- How to resize image to have maximum width of 1280px
- How to prompt for access again after UIImageWriteToSavedPhotosAlbum in Swift
- Convert a String to Data in Swift
Related Questions in CATRANSFORM3DROTATE
- 3D object Rotation with Javascript
- iOS Swift - How to do 360 degree flip animation using CABasicAnimation and CATransform3DRotate with "m34" transform?
- Swift - Rotating Image in 3D
- CATransformation3D Transformed Label not saving on image
- Can't change AnchorPoint for CAShapeLayer iOS Swift
- How to avoid tilt/flip on CATransform3D rotation in iOS?
- CATransform3D perspective not working on CATransformLayer
- Understanding CATransform3DRotate / CATransform3DMakeRotation
- How to rotate UIView in 3D?
- Chaining three CATtansform3D in Swift
- iOS: Applying CATransform3DRotate and CATransform3DScale does not have desired effect on MKMapView
- Rotate views as a cube with CATransform3DRotate vertically instead of horizontally?
- How to get proper z-ordering CATransform3D
- UIPanGestureRecognizer - translationInView with CATransform3D
- CATransform3DRotate level by UIPanGestureRecognizer
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Try this code :