You are setting the projection matrix to just an orthographic view. This means that changes in the distance from the camera will not affect the size of the object on the screen.
In a perspective projection far things are smaller, that is not true for an orthographic projection.
So in your vertex calculations the Z coordinate is controlled by i, but not the X and Y, they are only controlled by the trigonometry, and in particular, while refpx
and refpy
change, the size of the object in the XY plane never does (because the only variation is a sin or cosine term added to the refpx
and refpy
values).
So that's why: it can't vary, because you've got nothing in the math that calculates X and Y coordinates that varies the size by distance. On its own Z will make no difference to the size on screen unless you set a perspective transform in the projection matrix. Use gluPerspective
for ease, or assemble your own camera matrix, the math is here: http://en.wikipedia.org/wiki/3D_projection#Perspective_projection