Images rotate along y axis - iphone

How can let the images rotate along y axis?
I try to use this code,but it just rotate along image's y axis.
imageView.layer.transform = CATransform3DConcat(imageView.layer.transform, CATransform3DMakeRotation(180,0.0,1.0,0.0));
Anybody can solve my question?many thanks.

Translate first (by half of image width) and then rotate.

Related

Rotate an image around x or y axis in Matlab

If a camera is looking at say 6 evenly spaced dots in the real world it would look like the image below if the camera is looking at the image straight on with no rotation in the x, y or z axis
The z-axis is perpendicular to the image sensor so rotation around the z-axis is simple, it's just a tilt of the image. If I were to rotate the camera (or objects being looked at) around the x axis (if the x-axis is up down) the rows and columns will no longer be parallel and would project off to a vanishing point, like this.
What I would like to do is take a 2 dimensional image of say, dots, and be able to apply different rotations around the x,y and z axes independently. I've experimented with reading my image in Matlab and multiplying by a rotation matrix, or even a full camera matrix but I can't figure out how to take a 2D image, simulate rotating it around the x axis and then saving that back to an image. So that my original grid of dots would look like the bottom image with lines going off to a vanishing point. I've seen some examples using imwarp but I didn't see how I can set the angle of rotation. I'm working on camera calibration so I really want to be able to specify an angle of rotation around each axis.
Thanks for any help.

How to rotate the axis labels in Google image chart

I want to rotate x axis labels according to attached screenshot, But i am not finding any solution in google image chart.
Also how to put the label on top of the y axis, see the attached screenshot.
This screenshot the x axis labels rotate in approx 60 deg
In this Image the x axis labels appears in vertical format
How to put the query for axis rotation in
chart.apis.google.com/chart link
Thanks,

How to rotate an image about a point that is not the image's center point using MATLAB?

What is the method to use to rotate an image about a point that is not the image's center point using MATLAB?
Two rotations of the same angle are equal up to a translation. So you can just do rotation around the center, and then translate the image to put your own center of rotation at its old position.
The help to 'rotate' says:
ROTATE Rotate objects about specified origin and direction.
ROTATE(H,[THETA PHI],ALPHA) rotates the objects with handles H
through angle ALPHA about an axis described by the 2-element
direction vector [THETA PHI] (spherical coordinates).
All the angles are in degrees. The handles in H must be children
of the same axes.
...
ROTATE(...,ORIGIN) uses the point ORIGIN = [x0,y0,y0] as the center
of rotation instead of the center of the plot box.
To rotate about a point other than the origin you:
Translate the point you want to rotate around to the origin. For example, if you want to rotate around (3,5), you would translate by (-3,-5).
Perform your rotation.
Undo the initial translation. So in my example you would now translate by (+3,+5).

UIImage rotation axis

I want to rotate an image (UIImage) but can only do it from a default axis which is dead centre of the image ! as in Fig A. I want to move the axis to the centre of the x axis at the foot of the image as in Fig B. Can someone help me with this? I can only think of work arounds such as placing the image on an imaginary circle around the origin where the centre of the image would be where I position, then rotate the objects. This is too complicated and hopefully unneccessary. Imagine i want to place a number of images around a clock face with the origin in the centre where the clock hands originate, that's what I want to achieve. (The maths for doing this would also be appreciated).
(mid x axis and mid y axis).
Try using the view's underlying CALayer's anchorPoint property.
http://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004500-CH1-SW36
I think you can do it by first rotating using CGContextRotateCTM and then shifting that center point to the point you want it to be by using CGContextTranslateCTM
Like rotate 90 degree first to right
then shift center(x,y) to newPoint((x- width/2), (y - height/2)) here width and height are of rotated image.
I hope this helps.

iPhone CALayer's rotation axis

I'm rotating a CALayer on the X axis, but even if it's displaced on the Z axis, it uses the Z = 0 as axis for the rotation?
Is there a way of telling it to use the bottom of the plane, as the axis?
Thank you!
The transform of a CALayer uses the layer's anchor as its origin. You could try adjusting the anchorPoint and anchorPointZ properties of the layer.