I am new to opengl. I am drawing a map in android using opengl ES2.0. When i touch on screen i am getting screen coordinates. i want these coordinates to be converted into world coordinates. The code i found through research is as follows:
vec3 UnProjectPoint( const vec3& Point, const max4& Projection, const mat4& ModelView )
{
vec4 R( Point, 1.0f );
R.x = 2.0f * R.x - 1.0f;
R.y = 2.0f * R.y - 1.0f;
R.y = -R.y;
R.z = 1.0f;
R = Projection.GetInversed() * R;
R = ModelView.GetInversed() * R;
return R.ToVec3();
}
but android is not allowing me to use vec3 and vec4? I also use built in gluunproject function but this function is also not giving me correct results.