android - OpenGL depth calculation -
i have square view 100dp x 100dp , want same size square opengl.
my problem how control size of square ?
in opengl have vertices of surface, z coordinate , angle of gluperspective function (fovy)
private float[] vertices = { -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f }
fovy = 45.0
z = ??
how should calculate size of square ???
if want draw square of same size need orthographic projection, , setting transforms identity.
then size of square equal it's size on screen.
Comments
Post a Comment