I have a pseudo 3d game I'm working on. I say pseudo, I am actually using a 3d projection algorithm but for most it has more in common with a pseudo 3d game.
I have game objects that go up and down the z axis, I've botched together a simple scaling factor, It works sort of but I'd rather do it better. Is there a better way to do this?
I am using
screenx = worldx * constant / worldz
screeny = worldy * constant / worldz
game objects only travel up and down the z axis for the most part, I know I could convert every point using the above algorithm but this seems overly verbose and expensive.
currently I'm using
float scaleFactor = 1 - std::max(2 * (zCoord * 0.001), 0.0);
and applying a transformation matrix on both x and y with the result
But this method is hard to tweak and get looking correctly.