# Need help projecting 2D projectile motion in 2.5/isometric 2D game

So I’ve been researching this a lot and have hit a road block. I’ve read pretty much every thread on here regarding this and while I understand the concept I don’t understand how to implement it. For reference I’m using Godot, but the explanation does not need to be in gdscript or anything.

Basically I have a projectile launcher and an isometric perspective. The best way I can describe what I am trying to achieve is a 8/16 bit Baseball game which many did this quite well. Visually simulating height and 3D physics in a 2D game.

I understand and have in my code the basic kinematic equations. So I can input variables such as initial velocity and the angle. I then get the X and Y position output as variables that update each processing tick, in this case 60 fps.

I’m using kinematic equations because I want to use those values in other places like the total distance and max height.

But this is in a 2D plane, basically from the side view, which would be perfect if I was making a side scroller.

I am having trouble projecting this XY position into the isometric view of my game.

Basically I have a distance and a height of my projectile.

• – DMGregory Feb 8 at 22:16

## 1 Answer

But this is in a 2D plane, basically from the side view, which would be perfect if I was making a side scroller.

I am having trouble projecting this XY position into the isometric view of my game.

We are going to define an skewed coordinate system. For that coordinate system the vertical will remain vertical. But the horizontal will be a vector in the direction of the throw.

So you have two unit vectors up and forth. Where up is vertical, and forth is the direction on the isometric plane. Both unit vectors (in whatever scale you are using).

Now, multiply them by your coordinates. The final position is:

var position = X * forth + Y * up;


Note: this position is relative to the origin of the throw.

Or if you prefer:

var position = Vector2(X * forth.x + Y * up.x, X * forth.y + Y * up.y);


Which, given that up is vertical, and unit length, is the same as:

var position = Vector2(X * forth.x, X * forth.y + Y);


As you can see when forth is Vector(1, 0), you would have Vector2(X, Y), which is the case of the side view.

If you want the position on the ground (for example, for a shadow), you replace Y with the height of the terrain. Assuming the height of the terrain is 0 (for example, for a flat terrain), then it is just X * forth.