I am working on a game in which cubes fall from the sky. Right now my program draws orthogonal cubes. I would like them to appear in perspective, so they act more realistically.
To be more specific, when they are high in the sky, you should see the bottom face of the cubes. As they fall down they should appear to rotate so that you cannot see the bottom face once they are on level with your eye.
Right now I calculating the 2d polygon to draw on the screen in the following order:
0. (The cube begins as a unit cube centered at the origin)
I thought that the formula in step 4 was all I needed for perspective, but the cubes still appear from the same angle no matter what their x or y location is on the screen. Perhaps I am doing something in the wrong order, or perhaps I am missing a step.
Any insight is appreciated. I can post more specific code examples if needed, though I like to keep things general.
What is the x and y values you are getting as the program is running? Also what is the calculations for steps 1-3?