# 2d projectile projection

## Recommended Posts

I'm trying to simulate a 3d projectile using a 2D engine. I have made the calculations to find the position in 3D space but have a hard time with projecting in in 2D.

##### Share on other sites
1 hour ago, Victor Ks said:

I have made the calculations to find the position in 3D space but have a hard time with projecting in in 2D.

Can you link a drawing explaining this or a image of the game.

If it's for a 2D First Person Shooter then you just use the X and Y for location and scale the projectile using Z.

##### Share on other sites

Sure, it is top down and uses top down terrain but all the objects are rendered in isometric angle which gives an isometric illusion. I've tried isometric projection and it doesn't work though.  Is it possible to achieve this projection without my game being isometric? and what alternatives do I have maybe a tilt at x axis

##### Share on other sites

Oh Fudge, do you need this to be real accurate or only visual appealing?

If you just want it visual appealing use the starting point(Archer) and end point(Target), then you can use a Curve to draw the path the arrow follows.

Brezier= (1-t)(1-t)*p0+2(1-t)t*p1+t*t*p2

use it on each axis like this:

BezInX = 10
BezInY = 50 //Play with these to get the right look

int BrezierX = (int) (  (1-t)*(1-t)*ArcherX+ 2*(1-t)*t* BezInX+t*t*TargetX);
int BrezierY = (int) (  (1-t)*(1-t)*ArcherY+ 2*(1-t)*t* BezInY+t*t*TargetY);

The two other ways I can think of doing this is to use a actual 3D coordinates with 2D art OR projecting. 3D is the way I would do it although that is only because it would allow me to use the above curve and leave projecting to the camera.

The problem with projecting is that the math gets very complex fast and you need to do all the calculations for the game on a separate grid and cast back and forth.

Here is a example of what I mean: http://clintbellanger.net/articles/isometric_math/

##### Share on other sites

Thanks for the help I've managed to project it to isometric and back and the result is good but now I have to account for the arrow rotation as well.

So how should I approach that?? I can find the 3D rotation along the 3 axes but can't figure out how to transform them to 2D.

## Create an account

Register a new account

1. 1
2. 2
Rutin
22
3. 3
JoeJ
18
4. 4
5. 5

• 15
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631724
• Total Posts
3001903
×