开发者

iOS - rotating a sphere and responding to touch

开发者 https://www.devze.com 2023-02-22 05:35 出处:网络
I\'ve been tasked with creating a sphere that can be rotated by touch (or animated) along one axis, like a regular globe. I should also be able to draw animated lines on this sphere (eg. draw a line b

I've been tasked with creating a sphere that can be rotated by touch (or animated) along one axis, like a regular globe. I should also be able to draw animated lines on this sphere (eg. draw a line between Sydney and New York). I usually do all my animations in 2D, typically using core animation as I've never really had a need to do anything else. I have a feeling that this sort of problem though requires me to jump into OpenGL.

My question is whether it would be possible to achieve this using core animation (time is of the essence), or if I do need to quickly learn OpenGL. If so, is this a fairly simple problem to solve? I'm a pretty good programmer, but I have no OpenGL experience. Would a capable programmer be able to do this in say 2 weeks?

As a further question, supposing I do use OpenGL, if I then need to do other things in the开发者_如何学JAVA project (eg. show different screens, or show screens over the top of the sphere), am I able to use UIKit or does the entire project need to be in OpenGL?


  1. Core Animation is for animating views, and basically a 2D animation layer - so it's a no-go for the 3D rotating sphere.
  2. Drawing a textured sphere is rather easy, see this sample
  3. Mixing GL and regular UIView's is not a problem. You can overlay regular controls over the GL view.
0

精彩评论

暂无评论...
验证码 换一张
取 消