3 * Copyright (C) 2009 Julien Isorce <julien.isorce@gmail.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #extension GL_ARB_texture_rectangle : enable
22 uniform mat4 u_matrix;
23 uniform float xrot_degree, yrot_degree, zrot_degree;
24 attribute vec4 a_position;
25 attribute vec2 a_texCoord;
26 varying vec2 v_texCoord;
29 float PI = 3.14159265;
30 float xrot = xrot_degree*2.0*PI/360.0;
31 float yrot = yrot_degree*2.0*PI/360.0;
32 float zrot = zrot_degree*2.0*PI/360.0;
35 0.0, cos(xrot), sin(xrot), 0.0,
36 0.0, -sin(xrot), cos(xrot), 0.0,
39 cos(yrot), 0.0, -sin(yrot), 0.0,
41 sin(yrot), 0.0, cos(yrot), 0.0,
44 cos(zrot), sin(zrot), 0.0, 0.0,
45 -sin(zrot), cos(zrot), 0.0, 0.0,
48 gl_Position = u_matrix * matZ * matY * matX * a_position;
49 v_texCoord = a_texCoord;