Sign in to follow this  


Recommended Posts

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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this