Use accelerometer - iphone

How to rotate the UIImageView on z-axis with using accelerometer in iPhone device. Please help me out with any source code.

The z-direction points towards you, so to say. Try accessing the layer of the view. It should have a z-parameter.
here is the accelerometer example code ...
http://www.devx.com/wireless/Article/44799/1954
There is also SO post
How can I rotate an image in response to the iPhone's accelerometer?

Related

Detect ios Device is hold Perfect Vertically

I want to detect the device is hold vertically just like when we are taking the Panorama Picture.
What should be the condition for Accelerometer for X,Y and Z-axis?
Help me to solve this.
Thank you,
The force of gravity is always applied to the raw accelerometer, so if the force fector is straight down, then the phone is straight.

Single Touch Rotation Using Clip

I would like to rotate an image by using the rotation point and single touch. Can you please any one help me to do this?
Thanks in advance.
Hi have a look on this once....
Touch rotate image
SO link

Creating a 360 degrees image turntable viewcontroller?

I want to create a 360 degree turntable showing lots of pictures (12, 24 or 36) by controlling that rotation with touch events (like that example but coded for an iOS app natively).
The simplest idea depending on the touch position is to load that specific uiimage.
Any ideas what's the best practice for that? Is there a chance to create that image-turntable with the help of coreanimation faster? Any other hints on that? Any other projects known where I can get some help on that?
Thanks for your time and hints in the right direction.
Here's another example for an ipad-app from the "audi a8".
From the first example it becomes obvious that the objects have actually been photographed for each angle of rotation. This is the really tricky part. You will need a tripod and a camera with remote control, and if possible also a rotational platter to keep angles consistent.
Implementation is relatively straightforward. As you guessed, you just track the touch positions and, depending on delta to the last touch position, show the appropriate image.
well, you can just use the HTML/CSS/JS used in the same example... just load that in an UIWebView in your app and load your site embedded as a resource...
Subclass UIImageView, load array of your frames, handle tap movement over the screen y-axis and change active image accordingly. Don't forget to loop your images. :)

How can I move image with the help of accelerometer iphone xcode?

I am working on xcode4.1 not in coca 2d. I want to handle image through accelerometer. How can I do this?
Use an UIImageView to display it. Use the center property to move it on the screen.
Use the UIAccelerometerDelegate to get the move of the phone.

rotate uiview using touch (ipad and iphone)

I am trying to design another app and am struggling to think of the best way to do it. I'm after some advice please!
If you imaging a bicycle wheel in the middle of the ipad (and iPhone)... I want the user to be able to click on the tyre and spin it to the left or right. Depending on the speed of the swish will drive the speed of the wheel rotation.
It should rotate around the centre of the wheel and not move any other direction.
Do I need to use some graphics code, or simply listen for the touch, check the area they touched, then rotate the image around it's centre left or right?
Really I'm after some pointers around the methods to use - I'm not being lazy and asking for code, but if anyone knows of tutorials - that would help immensely!!
Thanks for any info.
Your best bet is to use one of the UIGestureRecognizer subclasses, probably UIPanGestureRecognizer as it includes velocity.
Apple's SimpleGestureRecognizers project will help you get started.