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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -