Search code examples
ioscore-animationopengl-es-2.0

What should I use to draw a 3D trajectory line that I can rotate around - iOS


I am working on making an iOS game where a player can flick their finger to throw an object. After the object is thrown, I want to animate the trajectory of that object like in the linked image below. I also want to allow the player to rotate around the thrown object image in 3D. (think of someone throwing a baseball or a golfer hitting a ball and seeing the arc the ball makes in 3D)

My question is what would be the best way of accomplishing this?

I have looked into opengl-es 2.0, core animation, 3rd part frameworks like Cocos3D, etc. But I am not sure how low level I need to go to accomplish this.

Any guidance would be greatly appreciated!

trajectory Image


Solution

  • You can't use core animation. Core animation is 2.5D, not 3D. It allows you to animate flat image tiles in 3-D space. You'll need to use OpenGL or maybe SpriteKit or one of the other game APIs like Unity.

    Regardless of which framework, you'll need to understand 3-D transformation matrices and display frustums.

    Stack overflow is not a good site for "which framework is the best" type questions, so I'm not going to trying to answer that part of the question