As the title suggests, I am wondering if it's possible to emulate a 3d arrow trajectory to a top-down 2d game? If you would look at this clip of Age of Empires 2 game, especially when archers are firing from bottom to top. Can the parabola/arc of the trajectory (in that certain view angle) be emulated in a 2d orthographic, top-down game? So that the arrows would look like they're in 3d space. I know it's tricky but I wonder if there's some computation available for this.

enter image description here

If you could point me in the right direction or some sample code I would be very grateful. I've only implemented this projectile motion in a side-scroll view.

Thank you in advance.

  • \$\begingroup\$ There's a similar question answered on StackOverflow that may be of use to you here. The main insight is that projectile movement doesn't care about your rendering perspective. Looking at your scene top-down, side-on, full 3D perspective, etc. does not change the laws of physics or alter how projectiles move. All it changes is the rendering logic for where you draw the image on the screen. A projection matrix can handle this transformation from logical world simulation space to rendered screen space. \$\endgroup\$ – DMGregory Nov 28 '19 at 16:43
  • \$\begingroup\$ Thank you very much for the insight, I'll check that link and study the answer there. \$\endgroup\$ – Kai Nov 29 '19 at 7:58

Store the Z coordinate and move object as if it was in 3D space. When drawing on screen, add object's Z to Y (you can multiply Z by some constant to make world look 'flatter').


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.