move a UIImageView "up"


hi,
have uiimageview representing level of "artificial horizon" in plane. blue sky, brown ground. image clipped super view creates square.

[​img]

when i move nose of plane up, move image down:

[​img]

when move nose of plane down, move picture :

[​img]

called "pitch"

far i've been modifying x axis of image:

code:
 imagehorizon.center = cgpointmake(imagehorizon.center.x, imagehorizon.center.y + valuetomove); 
when "roll" plane rotate picture either left or right:

[​img]
code:
 imagehorizon.transform = cgaffinetransformrotate(imagehorizon.transform, angletorotate*(cgfloat)(m_pi/180)); 

now, problem once rotated picture , want modify "pitch", dont know formula use find correct x,y move picture towards sky or ground direction:

[​img]

in other words, when rotate picture angle β, x, y value add center of image move on red line ?

help,
tex
 



Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Mail will not Quit when shutting down

MacBook Air 2011 Reviews

What's the max amount of RAM an iMac can have to run BootCamp & Parallels Windows 7?