Convert height to openGL height - Android android.opengl

Android examples for android.opengl:OpenGL

Description

Convert height to openGL height

Demo Code


//package com.book2s;

public class Main {
    /**//w  w w .  j a va  2 s.com
     * Convert height to openGL height
     * 
     * @param height
     * @return Height in openGL
     */
    public static float toGLHeight(float height, float screenHeight) {
        return 2.0f * (height / screenHeight);
    }
}

Related Tutorials