hi,
have uiimageview representing level of "artificial horizon" in plane. blue sky, brown ground. image clipped super view creates square.
![[img]](proxy.php?image=http%3a%2f%2ff.cl.ly%2fitems%2f2w3i353z0d3s472l1d3y%2fscreen%2520shot%25202011-07-27%2520at%25207.29.38%2520pm.png&hash=4497980a153679fe69174194a0751158)
when i move nose of plane up, move image down:
![[img]](proxy.php?image=http%3a%2f%2ff.cl.ly%2fitems%2f1u3g2o1e3u2e442e0h15%2fscreen%2520shot%25202011-07-27%2520at%25207.31.39%2520pm.png&hash=739f0f50b3c071d66d1012080f3bfff4)
when move nose of plane down, move picture :
![[img]](proxy.php?image=http%3a%2f%2ff.cl.ly%2fitems%2f3b2s432l030r1x3a0z3c%2fscreen%2520shot%25202011-07-27%2520at%25207.33.36%2520pm.png&hash=670b3a3e5667ca759cbb126481fd3224)
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]](proxy.php?image=http%3a%2f%2ff.cl.ly%2fitems%2f2d0k010q2l2p2i0x1i2w%2fscreen%2520shot%25202011-07-27%2520at%25207.36.15%2520pm.png&hash=bae94d03f181c41cd4a846e1c709ee89)
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]](proxy.php?image=http%3a%2f%2ff.cl.ly%2fitems%2f1l0v3h2y0x2g0l0t2n1w%2fscreen%2520shot%25202011-07-27%2520at%25207.42.17%2520pm%2520copy.png&hash=a78f8f46a51d27ad3704e3c2882be75a)
in other words, when rotate picture angle β, x, y value add center of image move on red line ?
help,
tex
maybe : http://forum.onlineconversion.com/showthread.php?t=5408
know have seen better tutorial on this, can't find anymore, sorry.
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
Post a Comment