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