Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply 3D rotation to iPhone view

I would like apply a 3D rotation on a view (in particular to a UILabel) in iPhone. What's the simplest way to do this?

A code example will be much appreciated.

like image 348
hpique Avatar asked May 11 '10 12:05

hpique


1 Answers

For 2D rotation use:

//rotate label in 45 degrees
label.transform = CGAffineTransformMakeRotation( M_PI/4 );

For 3D transformations see this thread:

CATransform3D _3Dt = CATransform3DMakeRotation(radians(90.0f), 1.0, 0.0, 0.0);
like image 149
sashaeve Avatar answered Sep 21 '22 20:09

sashaeve